diff options
author | Dr. Stephen Henson <steve@openssl.org> | 2016-03-10 15:04:46 +0000 |
---|---|---|
committer | Dr. Stephen Henson <steve@openssl.org> | 2016-03-11 17:40:47 +0000 |
commit | a6eb1ce6a989d01bb00e9749789b690744be506c (patch) | |
tree | c4071e00c47ba6c7fc91a50d26d36052edf134d8 /crypto/pkcs12/p12_p8e.c | |
parent | bb26842d1c8f99c1267b45361a2fc76822c0f913 (diff) |
Make X509_SIG opaque.
Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'crypto/pkcs12/p12_p8e.c')
-rw-r--r-- | crypto/pkcs12/p12_p8e.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/crypto/pkcs12/p12_p8e.c b/crypto/pkcs12/p12_p8e.c index a6255155ba..b79ca64272 100644 --- a/crypto/pkcs12/p12_p8e.c +++ b/crypto/pkcs12/p12_p8e.c @@ -59,6 +59,7 @@ #include <stdio.h> #include "internal/cryptlib.h" #include <openssl/pkcs12.h> +#include "internal/x509_int.h" X509_SIG *PKCS8_encrypt(int pbe_nid, const EVP_CIPHER *cipher, const char *pass, int passlen, @@ -103,13 +104,13 @@ X509_SIG *PKCS8_set0_pbe(const char *pass, int passlen, return NULL; } - if ((p8 = X509_SIG_new()) == NULL) { + p8 = OPENSSL_zalloc(sizeof(*p8)); + + if (p8 == NULL) { PKCS12err(PKCS12_F_PKCS8_SET0_PBE, ERR_R_MALLOC_FAILURE); ASN1_OCTET_STRING_free(enckey); return NULL; } - X509_ALGOR_free(p8->algor); - ASN1_OCTET_STRING_free(p8->digest); p8->algor = pbe; p8->digest = enckey; |