test(s2n-quic): verify TLS buffering limits from providers #2596
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Release Summary:
Resolved issues:
resolves #332
Description of changes:
Add two tests with
S2N-TLSandRustlsTLS providers to verify that TLS providers already implement buffering limit for handshake messages. I checked both implementations and verify that bothS2N-TLSandRustlsput a cap of 64KB on handshake messages: S2N Limit, Rustls Limit. The tests added in this PR will verify that behavior, which proves the RFC behavior.The method I used to generate large handshake message is to fill the
client alpnextension with 4665fake-protocols. Each fake protocol is 13 bytes, and TLS providers write a one byte length prefix in front of each alpn. That would makes the alpn extension along to be 65310 bytes (14 * 4665). With other data in the Client Hello, the payload can easily exceed 64KB (65536 bytes).I set up two event subscribers to listen for a connection closed event and a client hello handle event in the server. We expect the server to receive a
tls_client_hellopayload to be larger than 64KB and the server closes the connection after it attempt to parse the large Client Hello.Call-outs:
S2N-TLSversion tov0.3.16, because we need the newest version to unblock sending large Client Hello. The previous problem is resolved in fix: tainted handshake.io and add large client hello test s2n-tls#5208.UNEXPECTED_MESSAGEerror while Rustls emits anINTERNAL_ERROR.fake-protocols extension which makes the alpn extension size very close toUINT16_MAX. The rest of the data will make the entire Client Hello message to be larger than 64KB.Relevant PR and Issues related to this on S2N-TLS and Rustls:
aws/s2n-tls#5208
rustls/rustls#698
Testing:
CI will run the tests for this PR. We should verify if the
buffer_limit_testis passing:By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.