Call OCSP Stapling callback after ciphersuite has been chosen, so the
right response is stapled. Also change SSL_get_certificate() so it returns the certificate actually sent. See http://rt.openssl.org/Ticket/Display.html?id=2836.
This commit is contained in:
@@ -2287,7 +2287,7 @@ int ssl_check_srvr_ecc_cert_and_alg(X509 *x, SSL *s)
|
||||
#endif
|
||||
|
||||
/* THIS NEEDS CLEANING UP */
|
||||
X509 *ssl_get_server_send_cert(SSL *s)
|
||||
X509 *ssl_get_server_send_cert(const SSL *s)
|
||||
{
|
||||
unsigned long alg_k,alg_a;
|
||||
CERT *c;
|
||||
@@ -2780,7 +2780,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);
|
||||
|
Reference in New Issue
Block a user