summaryrefslogtreecommitdiffstats
path: root/ssl/s3_lib.c
diff options
context:
space:
mode:
authorDr. Stephen Henson <steve@openssl.org>2016-07-19 16:03:10 +0100
committerDr. Stephen Henson <steve@openssl.org>2016-07-20 00:09:46 +0100
commit52eede5a970fdb30c4ed6d3663e51f36bd1b1c73 (patch)
tree39e5dd56e8a642be949f7d5fe4fc328fbb3c604e /ssl/s3_lib.c
parentfb9339827bfba3e70719d245e905a22101010678 (diff)
Sanity check in ssl_get_algorithm2().
RT#4600 Reviewed-by: Rich Salz <rsalz@openssl.org>
Diffstat (limited to 'ssl/s3_lib.c')
-rw-r--r--ssl/s3_lib.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/ssl/s3_lib.c b/ssl/s3_lib.c
index 8218c2fa74..9158f21b96 100644
--- a/ssl/s3_lib.c
+++ b/ssl/s3_lib.c
@@ -3882,7 +3882,10 @@ int ssl3_renegotiate_check(SSL *s)
*/
long ssl_get_algorithm2(SSL *s)
{
- long alg2 = s->s3->tmp.new_cipher->algorithm2;
+ long alg2;
+ if (s->s3 == NULL || s->s3->tmp.new_cipher == NULL)
+ return -1;
+ alg2 = s->s3->tmp.new_cipher->algorithm2;
if (s->method->ssl3_enc->enc_flags & SSL_ENC_FLAG_SHA256_PRF) {
if (alg2 == (SSL_HANDSHAKE_MAC_DEFAULT | TLS1_PRF))
return SSL_HANDSHAKE_MAC_SHA256 | TLS1_PRF_SHA256;