diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/pkcs12/p12_kiss.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/pkcs12/p12_kiss.c b/src/lib/libcrypto/pkcs12/p12_kiss.c index 102ca3563b..e0385393d7 100644 --- a/src/lib/libcrypto/pkcs12/p12_kiss.c +++ b/src/lib/libcrypto/pkcs12/p12_kiss.c | |||
@@ -1,4 +1,4 @@ | |||
1 | /* $OpenBSD: p12_kiss.c,v 1.19 2017/01/29 17:49:23 beck Exp $ */ | 1 | /* $OpenBSD: p12_kiss.c,v 1.20 2021/04/24 18:16:39 tb Exp $ */ |
2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL | 2 | /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL |
3 | * project 1999. | 3 | * project 1999. |
4 | */ | 4 | */ |
@@ -132,10 +132,12 @@ PKCS12_parse(PKCS12 *p12, const char *pass, EVP_PKEY **pkey, X509 **cert, | |||
132 | 132 | ||
133 | while ((x = sk_X509_pop(ocerts))) { | 133 | while ((x = sk_X509_pop(ocerts))) { |
134 | if (pkey && *pkey && cert && !*cert) { | 134 | if (pkey && *pkey && cert && !*cert) { |
135 | ERR_set_mark(); | ||
135 | if (X509_check_private_key(x, *pkey)) { | 136 | if (X509_check_private_key(x, *pkey)) { |
136 | *cert = x; | 137 | *cert = x; |
137 | x = NULL; | 138 | x = NULL; |
138 | } | 139 | } |
140 | ERR_pop_to_mark(); | ||
139 | } | 141 | } |
140 | 142 | ||
141 | if (ca && x) { | 143 | if (ca && x) { |