Option to set current cert to server certificate.
[openssl.git] / ssl / ssl_lib.c
index d47f26865bf58f5f66e3f94c2c16aad7a200c535..eeed24de102d459853d29d98f61261ad1682e970 100644 (file)
@@ -2635,6 +2635,8 @@ CERT_PKEY *ssl_get_server_send_pkey(const SSL *s)
        int i;
 
        c = s->cert;
+       if (!s->s3 || !s->s3->tmp.new_cipher)
+               return NULL;
        ssl_set_cert_masks(c, s->s3->tmp.new_cipher);
 
 #ifdef OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL