]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Avoid "excessive message size" for session tickets
authorMatt Caswell <matt@openssl.org>
Wed, 23 Jun 2021 07:54:12 +0000 (08:54 +0100)
committerPauli <pauli@openssl.org>
Tue, 6 Jul 2021 00:54:37 +0000 (10:54 +1000)
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 https://github.com/openssl/openssl/pull/15877)

ssl/statem/statem_clnt.c
ssl/statem/statem_local.h

index 472a4a366b76288a7d2427d35de41723739f3b89..d5aa8797ffc05c8053bfd7b99cf5615c03174c88 100644 (file)
@@ -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;
index 25bfdffc6c0768df559bfe707cc700c02a388c69..1883b0166ff3ba4500318890f851a8592572a8d2 100644 (file)
@@ -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