diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2018-01-13 13:39:08 +0100 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2018-01-13 13:39:08 +0100 |
commit | 00abb1f201cbe1e40c2eef30819be115d3d04d10 (patch) | |
tree | 7eb36871dd7af02db7d2f59482644a56bc79d7bb /thirdparty/openssl/crypto/pkcs12/p12_kiss.c | |
parent | de0b31edd5b36b8c8016b7ca50c1823f2efbfa74 (diff) |
openssl: Update to pristine 1.0.2n (security update)
Diffstat (limited to 'thirdparty/openssl/crypto/pkcs12/p12_kiss.c')
-rw-r--r-- | thirdparty/openssl/crypto/pkcs12/p12_kiss.c | 21 |
1 files changed, 13 insertions, 8 deletions
diff --git a/thirdparty/openssl/crypto/pkcs12/p12_kiss.c b/thirdparty/openssl/crypto/pkcs12/p12_kiss.c index 9aa3c90c4e..1841f78f69 100644 --- a/thirdparty/openssl/crypto/pkcs12/p12_kiss.c +++ b/thirdparty/openssl/crypto/pkcs12/p12_kiss.c @@ -84,6 +84,12 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, { STACK_OF(X509) *ocerts = NULL; X509 *x = NULL; + + if (pkey) + *pkey = NULL; + if (cert) + *cert = NULL; + /* Check for NULL PKCS12 structure */ if (!p12) { @@ -92,11 +98,6 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, return 0; } - if (pkey) - *pkey = NULL; - if (cert) - *cert = NULL; - /* Check the mac */ /* @@ -125,7 +126,7 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, if (!ocerts) { PKCS12err(PKCS12_F_PKCS12_PARSE, ERR_R_MALLOC_FAILURE); - return 0; + goto err; } if (!parse_pk12(p12, pass, -1, pkey, ocerts)) { @@ -163,10 +164,14 @@ int PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, err: - if (pkey && *pkey) + if (pkey) { EVP_PKEY_free(*pkey); - if (cert && *cert) + *pkey = NULL; + } + if (cert) { X509_free(*cert); + *cert = NULL; + } if (x) X509_free(x); if (ocerts) |