diff options
author | Bernd Edlinger <bernd.edlinger@hotmail.de> | 2017-02-22 11:59:44 +0100 |
---|---|---|
committer | Rich Salz <rsalz@openssl.org> | 2017-02-22 09:36:02 -0500 |
commit | 79020b27beff060d02830870fdfd821fe8cbd439 (patch) | |
tree | c13800301dc5ecf1fcafa03be868614a8da01fa2 /ssl | |
parent | e4a3d0f96800e578ddb76dcc387125df65641500 (diff) | |
download | openssl-79020b27beff060d02830870fdfd821fe8cbd439.tar.gz |
Add some more consistency checks in tls_decrypt_ticket.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/2704)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/t1_lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/ssl/t1_lib.c b/ssl/t1_lib.c index 140b1f1d87..f13c0ada93 100644 --- a/ssl/t1_lib.c +++ b/ssl/t1_lib.c @@ -1315,6 +1315,11 @@ TICKET_RETURN tls_decrypt_ticket(SSL *s, const unsigned char *etick, sess = d2i_SSL_SESSION(NULL, &p, slen); OPENSSL_free(sdec); if (sess) { + /* Some additional consistency checks */ + if (p != sdec + slen || sess->session_id_length != 0) { + SSL_SESSION_free(sess); + return 2; + } /* * The session ID, if non-empty, is used by some clients to detect * that the ticket has been accepted. So we copy it to the session |