[go: nahoru, domu]

Skip to content

Commit

Permalink
Fix missing NULL checks in CKE processing
Browse files Browse the repository at this point in the history
Reviewed-by: Rich Salz <rsalz@openssl.org>
  • Loading branch information
mattcaswell committed Nov 23, 2016
1 parent 793d9b7 commit efbe126
Showing 1 changed file with 9 additions and 0 deletions.
9 changes: 9 additions & 0 deletions ssl/statem/statem_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -2258,6 +2258,11 @@ static int tls_construct_cke_dhe(SSL *s, unsigned char **p, int *len, int *al)
return 0;
}
ckey = ssl_generate_pkey(skey);
if (ckey == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_DHE, ERR_R_INTERNAL_ERROR);
return 0;
}

dh_clnt = EVP_PKEY_get0_DH(ckey);

if (dh_clnt == NULL || ssl_derive(s, ckey, skey) == 0) {
Expand Down Expand Up @@ -2296,6 +2301,10 @@ static int tls_construct_cke_ecdhe(SSL *s, unsigned char **p, int *len, int *al)
}

ckey = ssl_generate_pkey(skey);
if (ckey == NULL) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_ECDHE, ERR_R_INTERNAL_ERROR);
goto err;
}

if (ssl_derive(s, ckey, skey) == 0) {
SSLerr(SSL_F_TLS_CONSTRUCT_CKE_ECDHE, ERR_R_EVP_LIB);
Expand Down

0 comments on commit efbe126

Please sign in to comment.