diff options
author | Dr. Stephen Henson <steve@openssl.org> | 1999-08-17 12:58:01 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 1999-08-17 12:58:01 +0000 |
commit | c6c3450643ea00fde94e7f7471c9f134ec7d63b4 (patch) | |
tree | 59b0ab7204db5140559faa78de45b34d912bec94 /crypto/pkcs7/pk7_lib.c | |
parent | 2cfa692136da461b08008dd751595f8879672a36 (diff) |
Fix PKCS7_ENC_CONTENT_new() to include a sensible default content type and add
support for encrypted content type in PKCS7_set_content().
Diffstat (limited to 'crypto/pkcs7/pk7_lib.c')
-rw-r--r-- | crypto/pkcs7/pk7_lib.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/crypto/pkcs7/pk7_lib.c b/crypto/pkcs7/pk7_lib.c index 8b863d0558..22cbb174f8 100644 --- a/crypto/pkcs7/pk7_lib.c +++ b/crypto/pkcs7/pk7_lib.c @@ -165,9 +165,6 @@ 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_encrypted);*/ - break; case NID_pkcs7_enveloped: p7->type=obj; @@ -175,8 +172,14 @@ int PKCS7_set_type(PKCS7 *p7, int type) == NULL) goto err; ASN1_INTEGER_set(p7->d.enveloped->version,0); break; - case NID_pkcs7_digest: 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); + break; + + case NID_pkcs7_digest: default: PKCS7err(PKCS7_F_PKCS7_SET_TYPE,PKCS7_R_UNSUPPORTED_CONTENT_TYPE); goto err; |