Skip to content

test: add unit test for handling of dummy EncryptedClientHello#5871

Open
autumn-night wants to merge 1 commit into
aws:mainfrom
autumn-night:unit_test_for_dummy_ECH
Open

test: add unit test for handling of dummy EncryptedClientHello#5871
autumn-night wants to merge 1 commit into
aws:mainfrom
autumn-night:unit_test_for_dummy_ECH

Conversation

@autumn-night
Copy link
Copy Markdown

Goal

Add a unit test for handling a dummy ECH extension.

Why

A dummy EncryptedClientHello extension should be ignored by the server. Adding test coverage helps prevent regressions where such an extension might be misinterpreted or cause handshake failures.

How

Add a unit test that constructs a ClientHello containing a dummy ECH extension and verifies that the server ignores it and continues processing normally.

Callouts

Add a unit test that constructs a ClientHello containing a dummy ECH extension and verifies that the server ignores it and continues processing normally.

Testing

  • New unit test passes locally:
    cd tests/unit && S2N_DONT_MLOCK=1 ../../build/bin/s2n_client_hello_test
    (PASSED 994 tests)

  • Related existing unit tests continue to pass:
    ctest -L unit -R "s2n_client_hello"
    (5/5 passed)

Related

Closes #5697

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

@jouho jouho requested review from jouho and kaukabrizvi May 20, 2026 18:31
Comment on lines +1368 to +1369
0x03,
0x03,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I believe Encrypted Client Hello is only available in TLS 1.3, but this test exercises the TLS 1.2 path. Could we test this with a 1.3 ClientHello instead?

'r',
/* Extension type dummy ECH (0xFE0D) */
0xFE,
0x0D,
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Could we make this a constant, e.g. TLS_EXTENSION_ENCRYPTED_CLIENT_HELLO, and add a reference to the RFC that defines it?

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.

Unit Tests for "dummy" EncryptedClientHello

2 participants