Backport OCSP fix.

This commit is contained in:
Ben Laurie
2012-10-05 12:50:24 +00:00
parent f7d2402cab
commit 48bcdad0d5
4 changed files with 50 additions and 14 deletions

View File

@@ -1943,7 +1943,7 @@ int check_srvr_ecc_cert_and_alg(X509 *x, SSL_CIPHER *cs)
}
/* THIS NEEDS CLEANING UP */
X509 *ssl_get_server_send_cert(SSL *s)
X509 *ssl_get_server_send_cert(const SSL *s)
{
unsigned long alg,kalg;
CERT *c;
@@ -2420,7 +2420,9 @@ 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->cert != NULL)
if (s->server)
return(ssl_get_server_send_cert(s));
else if (s->cert != NULL)
return(s->cert->key->x509);
else
return(NULL);