Minor enhancement to PR#2836 fix. Instead of modifying SSL_get_certificate
change the current certificate (in s->cert->key) to the one used and then SSL_get_certificate and SSL_get_privatekey will automatically work.
This commit is contained in:
@@ -2833,14 +2833,6 @@ void ssl_clear_cipher_ctx(SSL *s)
|
||||
/* Fix this function so that it takes an optional type parameter */
|
||||
X509 *SSL_get_certificate(const SSL *s)
|
||||
{
|
||||
if (s->server)
|
||||
{
|
||||
CERT_PKEY *certpkey;
|
||||
certpkey = ssl_get_server_send_pkey(s);
|
||||
if (certpkey && certpkey->x509)
|
||||
return certpkey->x509;
|
||||
}
|
||||
|
||||
if (s->cert != NULL)
|
||||
return(s->cert->key->x509);
|
||||
else
|
||||
|
Reference in New Issue
Block a user