From 3e701b2a57219523e039e78e0cc655852ca63e1b Mon Sep 17 00:00:00 2001 From: jsing <> Date: Sat, 24 May 2014 15:55:21 +0000 Subject: KNF. --- src/lib/libcrypto/cms/cms_cd.c | 47 +++++++++++++++++++++--------------------- 1 file changed, 23 insertions(+), 24 deletions(-) (limited to 'src/lib/libcrypto/cms/cms_cd.c') diff --git a/src/lib/libcrypto/cms/cms_cd.c b/src/lib/libcrypto/cms/cms_cd.c index 2021688101..ec48471df2 100644 --- a/src/lib/libcrypto/cms/cms_cd.c +++ b/src/lib/libcrypto/cms/cms_cd.c @@ -10,7 +10,7 @@ * are met: * * 1. Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. + * notice, this list of conditions and the following disclaimer. * * 2. Redistributions in binary form must reproduce the above copyright * notice, this list of conditions and the following disclaimer in @@ -69,19 +69,20 @@ DECLARE_ASN1_ITEM(CMS_CompressedData) /* CMS CompressedData Utilities */ -CMS_ContentInfo *cms_CompressedData_create(int comp_nid) - { +CMS_ContentInfo * +cms_CompressedData_create(int comp_nid) +{ CMS_ContentInfo *cms; CMS_CompressedData *cd; + /* Will need something cleverer if there is ever more than one * compression algorithm or parameters have some meaning... */ - if (comp_nid != NID_zlib_compression) - { + if (comp_nid != NID_zlib_compression) { CMSerr(CMS_F_CMS_COMPRESSEDDATA_CREATE, - CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); + CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); return NULL; - } + } cms = CMS_ContentInfo_new(); if (!cms) return NULL; @@ -97,40 +98,38 @@ CMS_ContentInfo *cms_CompressedData_create(int comp_nid) cd->version = 0; X509_ALGOR_set0(cd->compressionAlgorithm, - OBJ_nid2obj(NID_zlib_compression), - V_ASN1_UNDEF, NULL); + OBJ_nid2obj(NID_zlib_compression), + V_ASN1_UNDEF, NULL); cd->encapContentInfo->eContentType = OBJ_nid2obj(NID_pkcs7_data); return cms; - err: - +err: if (cms) CMS_ContentInfo_free(cms); - return NULL; - } +} -BIO *cms_CompressedData_init_bio(CMS_ContentInfo *cms) - { +BIO * +cms_CompressedData_init_bio(CMS_ContentInfo *cms) +{ CMS_CompressedData *cd; ASN1_OBJECT *compoid; - if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_compressedData) - { + + if (OBJ_obj2nid(cms->contentType) != NID_id_smime_ct_compressedData) { CMSerr(CMS_F_CMS_COMPRESSEDDATA_INIT_BIO, - CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA); + CMS_R_CONTENT_TYPE_NOT_COMPRESSED_DATA); return NULL; - } + } cd = cms->d.compressedData; X509_ALGOR_get0(&compoid, NULL, NULL, cd->compressionAlgorithm); - if (OBJ_obj2nid(compoid) != NID_zlib_compression) - { + if (OBJ_obj2nid(compoid) != NID_zlib_compression) { CMSerr(CMS_F_CMS_COMPRESSEDDATA_INIT_BIO, - CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); + CMS_R_UNSUPPORTED_COMPRESSION_ALGORITHM); return NULL; - } - return BIO_new(BIO_f_zlib()); } + return BIO_new(BIO_f_zlib()); +} #endif -- cgit v1.2.3-55-g6feb