mirror of
https://github.com/openssl/openssl.git
synced 2025-01-30 14:01:55 +08:00
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)
This commit is contained in:
parent
e4a3d0f968
commit
79020b27be
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user