TLS ECH keylogging#10259
Open
sebastian-carpenter wants to merge 2 commits into
Open
Conversation
Contributor
There was a problem hiding this comment.
Pull request overview
Adds TLS 1.3 ECH keylog support by exposing the HPKE shared secret and ECHConfig through existing TLS 1.3 secret/keylog callbacks to enable ECH ClientHello decryption in external tooling (e.g., Wireshark).
Changes:
- Introduces new
Tls13Secretlabels (ECH_SECRET,ECH_CONFIG) and wires them into TLS 1.3 keylog label mapping. - Captures the HPKE shared secret during HPKE sender/receiver setup and logs ECH secret/config at ECH finalize/extract points.
- Extends the TLS 1.3 keylog API test to validate presence of ECH labels (and now also checks
EXPORTER_SECRET).
Reviewed changes
Copilot reviewed 8 out of 8 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| wolfssl/wolfcrypt/hpke.h | Adds optional Hpke::echSecret storage and local init/free helpers under HAVE_SECRET_CALLBACK && HAVE_ECH. |
| wolfcrypt/src/hpke.c | Copies HPKE shared secret into echSecret when allocated; implements wc_HpkeInitEchSecret / wc_HpkeFreeEchSecret. |
| wolfssl/ssl.h | Extends enum Tls13Secret with ECH_SECRET / ECH_CONFIG under HAVE_ECH. |
| wolfssl/internal.h | Updates TLSX_FinalizeEch signature to accept WOLFSSL* ssl. |
| src/tls.c | Adds EchWriteKeyLog() and logs ECH secret/config in TLSX_FinalizeEch (client) and TLSX_ExtractEch (server). |
| src/tls13.c | Updates ECH finalize callsite; updates tls13ShowSecrets() string mapping for new labels. |
| src/internal.c | Updates OpenSSL-extra TLS 1.3 keylog label mapping to include ECH labels. |
| tests/api.c | Extends TLS 1.3 keylog test to expect ECH labels (and now EXPORTER_SECRET). |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
e3117f4 to
887b69e
Compare
Contributor
Author
|
Jenkins retest this please. |
wolfSSL-Fenrir-bot
left a comment
There was a problem hiding this comment.
Fenrir Automated Review — PR #10259
Scan targets checked: wolfcrypt-bugs, wolfcrypt-src, wolfssl-bugs, wolfssl-src
No new issues found in the changed files. ✅
dgarske
approved these changes
May 19, 2026
dgarske
requested changes
May 20, 2026
887b69e to
074b42c
Compare
074b42c to
050e538
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Description
Adds keylog support for TLS 1.3 ECH by exposing the HPKE shared secret and ECHConfig as new
ECH_SECRET/ECH_CONFIGlabels via the existingtls13SecretCband OpenSSLtls13KeyLogCbcallbacks. Enables Wireshark decryption of ECH-protected ClientHellos.https://www.ietf.org/archive/id/draft-ietf-tls-keylogfile-05.html#name-secret-labels-for-ech
Changes
Tls13Secretenum values, wired into keylog label tables.hpke.c: capture HPKE shared secret whenechSecretis allocated; newwc_HpkeInit/FreeEchSecrethelpers.tls.c:EchWriteKeyLog()emits both labels;TLSX_FinalizeEch/TLSX_ExtractEchnow takeWOLFSSL*and log after HPKE setup.HAVE_SECRET_CALLBACK+HAVE_ECH; no overhead when unused.Testing
test_wolfSSL_Tls13_Key_Logging_testto run an ECH handshake and assert the keylog file containsECH_SECRETandECH_CONFIG(and alsoEXPORTER_SECRET, which was previously unchecked).test_wolfSSL_Tls13_Key_Logging_testandtest_wolfSSL_Tls13_Key_Logging_rejectto verify the correct random is used.Checklist