You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 42b8e64
Browse filesBrowse the repository at this point in the historyBrowse files
Add the record_size_limit extension for TLS 1.3 and TLS 1.2, enabled with
--enable-recordsizelimit (CMake WOLFSSL_RECORDSIZELIMIT, macro
HAVE_RECORD_SIZE_LIMIT) and by --enable-all and --enable-tlsx.
- wolfSSL_UseRecordSizeLimit() / wolfSSL_CTX_UseRecordSizeLimit() set the
largest record payload this end accepts (64 to 16384, 0 to not
advertise). A limit of 16384 is advertised by default.
- The client offers it in the ClientHello; the server answers in
EncryptedExtensions under TLS 1.3 and in the ServerHello under TLS 1.2.
The TLS 1.3 wire value includes the content type byte.
- Records sent are capped to the peer's limit once encryption is on;
received records over our advertised limit are refused with
record_overflow, checked on the ciphertext length and again on the
decrypted plaintext. Early data a server receives is exempt.
- RFC 8449 Sect. 5: a server ignores max_fragment_length when both are in a
ClientHello, and a client aborts if a server sends both. The built-in
default stands aside when the application asked for max_fragment_length.
- EncryptedExtensions, CertificateRequest and NewSessionTicket are
fragmented across records when the peer's limit is smaller than the
message. SendTls13Certificate() refuses a limit too small for the
message's fixed header rather than writing past the fragment.
- Record compression and a record size limit refuse each other on one
connection, and compression is refused once the default limit has been
advertised or received.
- The limit is copied to a write-dup object and peer state is reset by
wolfSSL_clear().
- An application custom extension cannot be registered for type 28 when
the extension is built in.
Crypto-only and no-TLS builds turn the option off, in configure and CMake
alike; configure overrides an explicit --enable-recordsizelimit there with a
warning.
test_dtls_frag_ch's MTU is raised as the ClientHello grows by 6 bytes.
Copy file name to clipboardExpand all lines: .github/configs/os-check-linux.json
+9Lines changed: 9 additions & 0 deletions
Original file line number
Diff line number
Diff line change
@@ -2,6 +2,15 @@
2
2
{"name": "all-static", "minutes": 8,
3
3
"comment": "Static-only build, so configure defines WOLFSSL_TEST_STATIC_BUILD and the tests that call WOLFSSL_LOCAL functions directly are compiled and run.",
"comment": "RFC 8449 on its own. --enable-all covers it alongside everything else; this is the minimal build, which is where the extension's own guards get exercised.",
7
+
"configure": ["--enable-recordsizelimit"]},
8
+
{"name": "record-size-limit-tls12",
9
+
"comment": "RFC 8449 defines the extension for TLS 1.2 too, where the server answers in the ServerHello. Guards the parse dispatch staying outside the WOLFSSL_TLS13 block.",
"comment": "RFC 8449 alongside TLS record layer compression. Both are built, and each connection uses at most one: wolfSSL_set_compression() and wolfSSL_UseRecordSizeLimit() refuse each other, so this is where that pairing gets exercised.",
AS_IF([test "x$ENABLED_ECC" != "xno" || test "$ENABLED_CURVE25519" != "no" || test "x$ENABLED_CURVE448" = "xyes" || test "x$ENABLED_TLS13" = "xyes"],
@@ -11663,6 +11669,27 @@ AC_ARG_WITH([libz],
11663
11669
]
11664
11670
)
11665
11671
11672
+
# Record Size Limit (RFC 8449)
11673
+
AC_ARG_ENABLE([recordsizelimit],
11674
+
[AS_HELP_STRING([--enable-recordsizelimit],[Enable RFC 8449 record_size_limit, the byte-exact replacement for max_fragment_length. Applies to TLS 1.2 and TLS 1.3. A connection cannot both use it and compress its records, so wolfSSL_set_compression() and wolfSSL_UseRecordSizeLimit() refuse each other (default: disabled)])],
11675
+
[ ENABLED_RECORD_SIZE_LIMIT=$enableval ],
11676
+
[ ENABLED_RECORD_SIZE_LIMIT=no ]
11677
+
)
11678
+
dnl RFC 8449 defines the extension for TLS 1.2 as well as TLS 1.3, where the
11679
+
dnl server answers in the ServerHello rather than EncryptedExtensions, so no
11680
+
dnl TLS 1.3 dependency is imposed here. It does need TLS: the no-TLS defaults
11681
+
dnl above only cover an unset option, so an explicit --enable-recordsizelimit
11682
+
dnl is overridden here in a crypto-only or no-TLS build, as CMake does.
11683
+
if test "$ENABLED_RECORD_SIZE_LIMIT" = "yes" && test "$ENABLED_TLS" = "no"
11684
+
then
11685
+
AC_MSG_WARN([--enable-recordsizelimit needs TLS; disabled in this no-TLS build])
0 commit comments