diff options
author | Matt Caswell <matt@openssl.org> | 2015-03-11 17:01:38 +0000 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2015-03-12 09:25:32 +0000 |
commit | d813f9eb383a93e472e69750cd1edbb170205ad2 (patch) | |
tree | 0e848e1cbefaee6d16912d1326058391d618e9e2 /ssl | |
parent | c5f2b5336ab72e40ab91e2ca85639f51fa3178c6 (diff) |
SSL_check_chain fix
If SSL_check_chain is called with a NULL X509 object or a NULL EVP_PKEY
or the type of the public key is unrecognised then the local variable
|cpk| in tls1_check_chain does not get initialised. Subsequently an
attempt is made to deref it (after the "end" label), and a seg fault will
result.
Reviewed-by: Dr. Stephen Henson <steve@openssl.org>
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/t1_lib.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 8296ea1f5c..b6e878ae21 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -3910,10 +3910,10 @@ int tls1_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain, # endif } else { if (!x || !pk) - goto end; + return 0; idx = ssl_cert_type(x, pk); if (idx == -1) - goto end; + return 0; cpk = c->pkeys + idx; if (c->cert_flags & SSL_CERT_FLAGS_CHECK_TLS_STRICT) check_flags = CERT_PKEY_STRICT_FLAGS; |