summaryrefslogtreecommitdiff
path: root/crypto/openssl/apps/pkcs12.c
diff options
context:
space:
mode:
authorJacques Vidrine <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
committerJacques Vidrine <nectar@FreeBSD.org>2002-07-30 12:44:15 +0000
commitc1803d783676ddc1f7655e0a58c00f35ec8c4f45 (patch)
treea6133c35ab337984fbbd26293f8b1ad7a958132b /crypto/openssl/apps/pkcs12.c
parenta21b1b381ecca3813b44ac652d05a5133d3f4e2b (diff)
downloadsrc-test2-c1803d783676ddc1f7655e0a58c00f35ec8c4f45.tar.gz
src-test2-c1803d783676ddc1f7655e0a58c00f35ec8c4f45.zip
Notes
Diffstat (limited to 'crypto/openssl/apps/pkcs12.c')
-rw-r--r--crypto/openssl/apps/pkcs12.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/crypto/openssl/apps/pkcs12.c b/crypto/openssl/apps/pkcs12.c
index 6789169bdb48..aeba62ea08c9 100644
--- a/crypto/openssl/apps/pkcs12.c
+++ b/crypto/openssl/apps/pkcs12.c
@@ -749,7 +749,10 @@ int dump_certs_pkeys_bag (BIO *out, PKCS12_SAFEBAG *bag, char *pass,
print_attribs (out, bag->attrib, "Bag Attributes");
if (!(p8 = M_PKCS12_decrypt_skey (bag, pass, passlen)))
return 0;
- if (!(pkey = EVP_PKCS82PKEY (p8))) return 0;
+ if (!(pkey = EVP_PKCS82PKEY (p8))) {
+ PKCS8_PRIV_KEY_INFO_free(p8);
+ return 0;
+ }
print_attribs (out, p8->attributes, "Key Attributes");
PKCS8_PRIV_KEY_INFO_free(p8);
PEM_write_bio_PrivateKey (out, pkey, enc, NULL, 0, NULL, pempass);