diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2014-02-12 15:15:55 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2014-02-13 14:35:56 +0000 |
commit | 847865d0f9810a2f9c0eb7a5dc5d0c29f50b84ba (patch) | |
tree | 96020e68bfaf325294ad849b78fe991c42ad0197 /crypto/cms/cms_smime.c | |
parent | 4dce704145d2e197904116378d934516d21f0360 (diff) |
Add suppot for ASCII with CRLF canonicalisation.
Diffstat (limited to 'crypto/cms/cms_smime.c')
-rw-r--r-- | crypto/cms/cms_smime.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/crypto/cms/cms_smime.c b/crypto/cms/cms_smime.c index 8f1aa38ccc..e907b279ea 100644 --- a/crypto/cms/cms_smime.c +++ b/crypto/cms/cms_smime.c @@ -334,6 +334,12 @@ int CMS_verify(CMS_ContentInfo *cms, STACK_OF(X509) *certs, if (!dcont && !check_content(cms)) return 0; + if (dcont && !(flags & CMS_BINARY)) + { + const ASN1_OBJECT *coid = CMS_get0_eContentType(cms); + if (OBJ_obj2nid(coid) == NID_id_ct_asciiTextWithCRLF) + flags |= CMS_ASCIICRLF; + } /* Attempt to find all signer certificates */ @@ -519,6 +525,8 @@ CMS_ContentInfo *CMS_sign(X509 *signcert, EVP_PKEY *pkey, STACK_OF(X509) *certs, cms = CMS_ContentInfo_new(); if (!cms || !CMS_SignedData_init(cms)) goto merr; + if (flags & CMS_ASCIICRLF && !CMS_set1_eContentType(cms, OBJ_nid2obj(NID_id_ct_asciiTextWithCRLF))) + goto err; if (pkey && !CMS_add1_signer(cms, signcert, pkey, NULL, flags)) { |