Skip to content

Commit

Permalink
Avoid "excessive message size" for session tickets
Browse files Browse the repository at this point in the history
We received a report of an "excessive message size" for a received
session ticket. Our maximum size was significantly less than the theoretical
maximum. The server may put any data it likes in the session ticket
including (for example) the full certificate chain so we should be able to
handle longer tickets. Update the value to the maximum allowed by the spec.

Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from openssl#15877)
  • Loading branch information
mattcaswell authored and paulidale committed Jul 6, 2021
1 parent 2f61bc1 commit e54f0c9
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 1 deletion.
3 changes: 2 additions & 1 deletion ssl/statem/statem_clnt.c
Original file line number Diff line number Diff line change
Expand Up @@ -996,7 +996,8 @@ size_t ossl_statem_client_max_message_size(SSL *s)
return CCS_MAX_LENGTH;

case TLS_ST_CR_SESSION_TICKET:
return SSL3_RT_MAX_PLAIN_LENGTH;
return (SSL_IS_TLS13(s)) ? SESSION_TICKET_MAX_LENGTH_TLS13
: SESSION_TICKET_MAX_LENGTH_TLS12;

case TLS_ST_CR_FINISHED:
return FINISHED_MAX_LENGTH;
Expand Down
2 changes: 2 additions & 0 deletions ssl/statem/statem_local.h
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,8 @@
#define END_OF_EARLY_DATA_MAX_LENGTH 0
#define HELLO_RETRY_REQUEST_MAX_LENGTH 20000
#define ENCRYPTED_EXTENSIONS_MAX_LENGTH 20000
#define SESSION_TICKET_MAX_LENGTH_TLS13 131338
#define SESSION_TICKET_MAX_LENGTH_TLS12 65541
#define SERVER_KEY_EXCH_MAX_LENGTH 102400
#define SERVER_HELLO_DONE_MAX_LENGTH 0
#define KEY_UPDATE_MAX_LENGTH 1
Expand Down

0 comments on commit e54f0c9

Please sign in to comment.