Skip to content

refactor(tls-harness): use single test pair IO to allow for decryption#5648

Merged
jmayclin merged 2 commits intoaws:mainfrom
jmayclin:2025-12-03-view-io-refactor
Dec 4, 2025
Merged

refactor(tls-harness): use single test pair IO to allow for decryption#5648
jmayclin merged 2 commits intoaws:mainfrom
jmayclin:2025-12-03-view-io-refactor

Conversation

@jmayclin
Copy link
Copy Markdown
Contributor

@jmayclin jmayclin commented Dec 3, 2025

Goal

Allows TLS 1.3 decryption in integration tests.

Why

This will make it much easier to assert on certain qualities without having to reach into library internals. This is specifically motivated by TLS 1.3 Group Negotiation integration tests.

E.g. my draft of that test is here

How

It uses brass-aphid-wire. This is a series of crates that I wrote which allow for runtime TLS decryption of s2n-tls/rustls/openssl. Basically, wireshark but it's in-process and synchronous. This means that instead of having to faff about with packet captures and sockets, we can just directly plug it into our shared-memory IO test harness.

To use brass-aphid-wire, it requires both the client and server to have access to the StreamDecrypter. To achieve this I just made the actual TestPairIO reference counted, and now the client and server each get their own copy of that, instead of having to just reference count the individual fields that they want.

Callouts

This only works for TLS 1.3. my crates doesn't (currrently) support TLS 1.2

Testing

I added a unit test confirming decryption success/results.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@jmayclin jmayclin requested a review from kaukabrizvi December 3, 2025 21:12
@github-actions github-actions bot added the s2n-core team label Dec 3, 2025
@jmayclin jmayclin requested a review from maddeleine December 3, 2025 21:12
@jmayclin jmayclin marked this pull request as ready for review December 3, 2025 21:12
@jmayclin jmayclin added this pull request to the merge queue Dec 4, 2025
@github-merge-queue github-merge-queue bot removed this pull request from the merge queue due to failed status checks Dec 4, 2025
@jmayclin jmayclin added this pull request to the merge queue Dec 4, 2025
Merged via the queue into aws:main with commit f6ca8f0 Dec 4, 2025
53 checks passed
@jmayclin jmayclin deleted the 2025-12-03-view-io-refactor branch December 4, 2025 23:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants