Skip to content

Add maximum_name_length to TLS ECH padding#10326

Open
sebastian-carpenter wants to merge 1 commit intowolfSSL:masterfrom
sebastian-carpenter:tls-ech-maxnamelen
Open

Add maximum_name_length to TLS ECH padding#10326
sebastian-carpenter wants to merge 1 commit intowolfSSL:masterfrom
sebastian-carpenter:tls-ech-maxnamelen

Conversation

@sebastian-carpenter
Copy link
Copy Markdown
Contributor

Description

Improve TLS ECH ClientHelloInner padding to follow RFC 9849 §6.1.3, which uses the ECHConfig maximum_name_length to produce a stable padded length across SNIs.

  • Add WOLFSSL_EchConfig.maxNameLen and honor it when emitting/parsing ECHConfigs (previously hard-coded to 0 on emit and ignored on parse).
  • Add new public API wolfSSL_CTX_GenerateEchConfigEx() that takes a maxNameLen; the existing wolfSSL_CTX_GenerateEchConfig() becomes a thin wrapper passing 0.
  • Update SendTls13ClientHello() to compute padding from maxNameLen and the inner SNI length (with the spec's 9-byte fallback when no SNI is present), then round up to a 32-byte boundary.

Fixes zd#21504

Testing

Update callback in tests/api.c to use new *Ex function with a longer maximum name length. Kept some instances of the old wolfSSL_CTX_GenerateEchConfig to test with no max name length (i.e., shorter length).

Checklist

  • added tests
  • updated/added doxygen
  • updated appropriate READMEs
  • Updated manual and documentation

@sebastian-carpenter sebastian-carpenter self-assigned this Apr 27, 2026
Copilot AI review requested due to automatic review settings April 27, 2026 18:06
@github-actions
Copy link
Copy Markdown

github-actions Bot commented Apr 27, 2026

MemBrowse Memory Report

No memory changes detected for:

@sebastian-carpenter
Copy link
Copy Markdown
Contributor Author

Jenkins retest this please.

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.

1 participant