[openssl-dev] Problem with Commit 3fd181a8b5b85a1f7383e82438da494a08f7d843, Remove an option related to a deprecated flag.

John Hughes john at calva.com
Fri Feb 17 12:08:11 UTC 2017


This commit removes the cms and smime "-nooldmime" option on the grounds 
that the flags they use "CMS_NOOLDMIMETYPE" and "PKCS7_NOOLDMIMETYPE" 
are not used in the pkcs7/cms code.

But those flags *are* used.

In include/openssl/pkcs7.h we have:

# define PKCS7_NOOLDMIMETYPE     0x400

And in include/openssl/cms.h:

# define CMS_NOOLDMIMETYPE               0x400

And include/openssl/smime.h

# define SMIME_OLDMIME           0x400

And, in crypto/pkcs7/pk7mime.c:

int SMIME_write_PKCS7(BIO *bio, PKCS7 *p7, BIO *data, int flags)
{
...
     flags ^= SMIME_OLDMIME;

     return SMIME_write_ASN1(bio, (ASN1_VALUE *)p7, data, flags,
                             ctype_nid, NID_undef, mdalgs,
                             ASN1_ITEM_rptr(PKCS7));

And, finally in crypto/asn1/asn_mime.c:

int SMIME_write_ASN1(BIO *bio, ASN1_VALUE *val, BIO *data, int flags,
                      int ctype_nid, int econt_nid,
                      STACK_OF(X509_ALGOR) *mdalgs, const ASN1_ITEM *it)
{
...
     if (flags & SMIME_OLDMIME)
         mime_prefix = "application/x-pkcs7-";
     else
         mime_prefix = "application/pkcs7-";


That is to say the effect of setting the flag CMS_NOOLDMIMETYPE or 
PKCS7_NOOLDMIMETYPE is to *unset* the flag SMIME_OLDMIME in calls to 
SMIME_write_ASN1, and so tell SMIME_write_ASN1 to write new-style mime 
headers "application/pkcs7-" instead of the horrid old 
"application/x-pkcs7-".

TL; DR -- the flags "CMS_NOOLDMIMETYPE" and "PKCS7_NOOLDMIMETYPE" *are* 
used, and shouldn't be deprecated.


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mta.openssl.org/pipermail/openssl-dev/attachments/20170217/8d6aaf96/attachment-0001.html>


More information about the openssl-dev mailing list