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/pkcs12/p12_add.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/pkcs12/p12_add.c')
-rw-r--r-- | crypto/pkcs12/p12_add.c | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/crypto/pkcs12/p12_add.c b/crypto/pkcs12/p12_add.c index ae3d9de3b4..50a7d0ba25 100644 --- a/crypto/pkcs12/p12_add.c +++ b/crypto/pkcs12/p12_add.c @@ -157,13 +157,11 @@ PKCS7 *PKCS12_pack_p7encdata (int pbe_nid, const char *pass, int passlen, PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); return NULL; } - p7->type = OBJ_nid2obj(NID_pkcs7_encrypted); - if (!(p7->d.encrypted = PKCS7_ENCRYPT_new ())) { - PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); + if(!PKCS7_set_type(p7, NID_pkcs7_encrypted)) { + PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, + PKCS12_R_ERROR_SETTING_ENCRYPTED_DATA_TYPE); return NULL; } - ASN1_INTEGER_set (p7->d.encrypted->version, 0); - p7->d.encrypted->enc_data->content_type = OBJ_nid2obj(NID_pkcs7_data); if (!(pbe = PKCS5_pbe_set (pbe_nid, iter, salt, saltlen))) { PKCS12err(PKCS12_F_PKCS12_PACK_P7ENCDATA, ERR_R_MALLOC_FAILURE); return NULL; |