[openssl-commits] [openssl] master update
Matt Caswell
matt at openssl.org
Thu Feb 15 15:23:26 UTC 2018
The branch master has been updated
via c471521243c729d344c2ab641feed7cfb7b8a36d (commit)
from 812b15370613da4768d91b9e566fdf5a30c06805 (commit)
- Log -----------------------------------------------------------------
commit c471521243c729d344c2ab641feed7cfb7b8a36d
Author: Matt Caswell <matt at openssl.org>
Date: Mon Feb 12 16:24:59 2018 +0000
If s->ctx is NULL then this is an internal error
Coverity was complaining because we checked if s->ctx is NULL and then
later on in the function deref s->ctx anyway. In reality if s->ctx is
NULL then this is an internal error.
Reviewed-by: Ben Kaduk <kaduk at mit.edu>
(Merged from https://github.com/openssl/openssl/pull/5334)
-----------------------------------------------------------------------
Summary of changes:
ssl/statem/extensions.c | 11 ++++++++---
1 file changed, 8 insertions(+), 3 deletions(-)
diff --git a/ssl/statem/extensions.c b/ssl/statem/extensions.c
index 7d456f3..722943f 100644
--- a/ssl/statem/extensions.c
+++ b/ssl/statem/extensions.c
@@ -915,11 +915,16 @@ static int final_server_name(SSL *s, unsigned int context, int sent)
int altmp = SSL_AD_UNRECOGNIZED_NAME;
int was_ticket = (SSL_get_options(s) & SSL_OP_NO_TICKET) == 0;
- if (s->ctx != NULL && s->ctx->ext.servername_cb != 0)
+ if (!ossl_assert(s->ctx != NULL) || !ossl_assert(s->session_ctx != NULL)) {
+ SSLfatal(s, SSL_AD_INTERNAL_ERROR, SSL_F_FINAL_SERVER_NAME,
+ ERR_R_INTERNAL_ERROR);
+ return 0;
+ }
+
+ if (s->ctx->ext.servername_cb != NULL)
ret = s->ctx->ext.servername_cb(s, &altmp,
s->ctx->ext.servername_arg);
- else if (s->session_ctx != NULL
- && s->session_ctx->ext.servername_cb != 0)
+ else if (s->session_ctx->ext.servername_cb != NULL)
ret = s->session_ctx->ext.servername_cb(s, &altmp,
s->session_ctx->ext.servername_arg);
More information about the openssl-commits
mailing list