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.
--
openssl-dev mailing list
To unsubscribe: https://mta.openssl.org/mailman/listinfo/openssl-dev