Add debugging info to new ASN1 code to trace memory leaks.
[openssl.git] / crypto / pkcs7 / pk7_lib.c
index 656f0e9..f7b5da1 100644 (file)
@@ -169,18 +169,24 @@ int PKCS7_set_type(PKCS7 *p7, int type)
                if ((p7->d.signed_and_enveloped=PKCS7_SIGN_ENVELOPE_new())
                        == NULL) goto err;
                ASN1_INTEGER_set(p7->d.signed_and_enveloped->version,1);
+               p7->d.signed_and_enveloped->enc_data->content_type
+                                               = OBJ_nid2obj(NID_pkcs7_data);
                break;
        case NID_pkcs7_enveloped:
                p7->type=obj;
                if ((p7->d.enveloped=PKCS7_ENVELOPE_new())
                        == NULL) goto err;
                ASN1_INTEGER_set(p7->d.enveloped->version,0);
+               p7->d.enveloped->enc_data->content_type
+                                               = OBJ_nid2obj(NID_pkcs7_data);
                break;
        case NID_pkcs7_encrypted:
                p7->type=obj;
                if ((p7->d.encrypted=PKCS7_ENCRYPT_new())
                        == NULL) goto err;
                ASN1_INTEGER_set(p7->d.encrypted->version,0);
+               p7->d.encrypted->enc_data->content_type
+                                               = OBJ_nid2obj(NID_pkcs7_data);
                break;
 
        case NID_pkcs7_digest: