Implements: #27827 - RFC 8449 Record Size Limit for TLS by noctuelles · Pull Request #27916 · openssl/openssl · GitHub | Latest TMZ Celebrity News & Gossip | Watch TMZ Live
Skip to content

Implements: #27827 - RFC 8449 Record Size Limit for TLS #27916

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 24 commits into
base: master
Choose a base branch
from

Conversation

noctuelles
Copy link
Contributor

@noctuelles noctuelles commented Jun 27, 2025

Hi, this pull request implements the RFC 8449 Record Size Limit extension for TLS. This address the issue here.

This is still a work in progress, but this being my first "major" contribution to the project, I need some early reviews of some more experienced developers in the code base.

This extension provides major differences from the MFL (Maximum Fragment Length) extension already supported by OpenSSL :

  • RSL (Record Size Limit) does not apply to unprotected messages. That is, all handshake messages in earlier version of TLS ( <= 1.2) does not get fragmented over multiple records. The rationale here is that an implementation can already process an unprotected message at the byte granularity if they want to. This is not the case with protected messages because the entire message must be buffered before decryption and authentication.

  • The RSL can be asymmetric between a client and a server ; a client can advertise a Record Size Limit of 1024 bytes while a server can be more constraint and only accept 512 bytes. This was impossible with the MFL extension since the RFC mandates that the server have to echo back the MFL sent by the client.

  • The RSL can take arbitrary value between 64 and the negotiated protocol hard limit (2^14 for <= TLS 1.2 and 2^14 + 1 for TLS 1.3), or a future TLS extension that allow bigger record sizes. This is very different from the hard-coded power of two that the MFL extension uses.

This is the current list of task remaining as of 27/06/2025:

  • s_server option.
  • test suite for the extension and fix broken tests.
  • better documentation.
  • styling issues.

… when set. added tracing of the extension in SSL_trace.
… construction and parse function are not finished.
@noctuelles
Copy link
Contributor Author

noctuelles commented Jun 27, 2025

@mattcaswell and @t8m, could you take an early look and give me your feedback? Many thanks.

@h-vetinari
Copy link
Contributor

Have you seen #18248?

@noctuelles
Copy link
Contributor Author

Have you seen #18248?

No, thank you. When i wrote the issue I did not bother to check thoroughly since nobody mentioned this PR, this was a mistake. The codebase has changed quite a bit since ! This is still a valuable source of information for tests. I also did not write any automated tests and I have not implemented the session resumption mechanism.

Copy link
Contributor

@FdaSilvaYY FdaSilvaYY left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A bunch of style issues, resumption (seesion-hit) is not yet tested.
Need a bit more work.

&& !SSL_CTX_set_tlsext_record_size_limit(ctx,
record_size_limit)) {
goto end;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style: no need accolades around one line of code

goto end;
}

if (record_size_limit_set && maxfraglen > 0) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

style : one line -> no accolades

@@ -118,16 +121,16 @@ typedef struct extensions_definition_st {
* Extensions should be added to test/ext_internal_test.c as well, as that
* tests the ordering of the extensions.
*
* Each extension has an initialiser, a client and
* server side parser and a finaliser. The initialiser is called (if the
* Each extension has an initializer, a client and
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

your changes are large enough, no need to add this US/GB nits

int sent) {
unsigned int proto_record_hard_limit;

if (s->options & SSL_OP_NO_RECORD_SIZE_LIMIT_EXT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if ((bitfield & MASK) != 0)

* same value.
*/

if (s->options & SSL_OP_NO_RECORD_SIZE_LIMIT_EXT) {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: no accolades...

@@ -231,7 +269,7 @@ int tls_parse_ctos_srp(SSL_CONNECTION *s, PACKET *pkt, unsigned int context,
if (!PACKET_strndup(&srp_I, &s->srp_ctx.login)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return 0;
}
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

useless indent change

unsigned int context, X509 *x,
size_t chainidx)
{
if (s->options & SSL_OP_NO_RECORD_SIZE_LIMIT_EXT)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

test against 0 // != 0

|| !WPACKET_close(pkt)) {
SSLfatal(s, SSL_AD_INTERNAL_ERROR, ERR_R_INTERNAL_ERROR);
return EXT_RETURN_FAIL;
}
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: one indent less

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants

TMZ Celebrity News – Breaking Stories, Videos & Gossip

Looking for the latest TMZ celebrity news? You've come to the right place. From shocking Hollywood scandals to exclusive videos, TMZ delivers it all in real time.

Whether it’s a red carpet slip-up, a viral paparazzi moment, or a legal drama involving your favorite stars, TMZ news is always first to break the story. Stay in the loop with daily updates, insider tips, and jaw-dropping photos.

🎥 Watch TMZ Live

TMZ Live brings you daily celebrity news and interviews straight from the TMZ newsroom. Don’t miss a beat—watch now and see what’s trending in Hollywood.