diff options
Diffstat (limited to 'src/lib/libssl/ssl_rsa.c')
-rw-r--r-- | src/lib/libssl/ssl_rsa.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_rsa.c b/src/lib/libssl/ssl_rsa.c index 03828b6632..330390519b 100644 --- a/src/lib/libssl/ssl_rsa.c +++ b/src/lib/libssl/ssl_rsa.c | |||
@@ -207,7 +207,7 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) | |||
207 | ok=1; | 207 | ok=1; |
208 | else | 208 | else |
209 | #endif | 209 | #endif |
210 | if (!X509_check_private_key(c->pkeys[i].x509,pkey)) | 210 | if (!X509_check_private_key(c->pkeys[i].x509,pkey)) |
211 | { | 211 | { |
212 | if ((i == SSL_PKEY_DH_RSA) || (i == SSL_PKEY_DH_DSA)) | 212 | if ((i == SSL_PKEY_DH_RSA) || (i == SSL_PKEY_DH_DSA)) |
213 | { | 213 | { |
@@ -241,6 +241,8 @@ static int ssl_set_pkey(CERT *c, EVP_PKEY *pkey) | |||
241 | return(0); | 241 | return(0); |
242 | } | 242 | } |
243 | 243 | ||
244 | ERR_clear_error(); /* make sure no error from X509_check_private_key() | ||
245 | * is left if we have chosen to ignore it */ | ||
244 | if (c->pkeys[i].privatekey != NULL) | 246 | if (c->pkeys[i].privatekey != NULL) |
245 | EVP_PKEY_free(c->pkeys[i].privatekey); | 247 | EVP_PKEY_free(c->pkeys[i].privatekey); |
246 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); | 248 | CRYPTO_add(&pkey->references,1,CRYPTO_LOCK_EVP_PKEY); |