Skip to content

feat: support PSK binder reprocessing on HelloRetryRequest#389

Open
thesinakamali wants to merge 1 commit intorefraction-networking:masterfrom
thesinakamali:feature/psk-hrr-support
Open

feat: support PSK binder reprocessing on HelloRetryRequest#389
thesinakamali wants to merge 1 commit intorefraction-networking:masterfrom
thesinakamali:feature/psk-hrr-support

Conversation

@thesinakamali
Copy link

Previously, uTLS would return a hard error when a HelloRetryRequest was received and PSK identities were present in the ClientHello: "uTLS does not support reprocessing of PSK key triggered by HelloRetryRequest" (see #305)

This commit adds full HRR PSK support by:

  • Adding UpdateOnHRR method to the PreSharedKeyExtension interface
  • Implementing UpdateOnHRR on UtlsPreSharedKeyExtension to refresh the session, cipher suite, obfuscated ticket age, and store the previous ClientHello hash and ServerHello for transcript reconstruction
  • Extending PatchBuiltHello to reconstruct the HRR transcript (message_hash of first CH + ServerHello + second CH) per RFC 8446 Section 4.4.1 before recomputing PSK binders
  • Updating processHelloRetryRequest to call UpdateOnHRR + PatchBuiltHello with graceful fallback (clearing PSK on failure rather than aborting)

This enables TLS 1.3 session resumption to work correctly even when the server sends a HelloRetryRequest, which is common with post-quantum key exchanges and certain server configurations.

Previously, uTLS would return a hard error when a HelloRetryRequest was
received and PSK identities were present in the ClientHello:
"uTLS does not support reprocessing of PSK key triggered by HelloRetryRequest"

This commit adds full HRR PSK support by:

- Adding UpdateOnHRR method to the PreSharedKeyExtension interface
- Implementing UpdateOnHRR on UtlsPreSharedKeyExtension to refresh the
  session, cipher suite, obfuscated ticket age, and store the previous
  ClientHello hash and ServerHello for transcript reconstruction
- Extending PatchBuiltHello to reconstruct the HRR transcript
  (message_hash of first CH + ServerHello + second CH) per RFC 8446
  Section 4.4.1 before recomputing PSK binders
- Updating processHelloRetryRequest to call UpdateOnHRR + PatchBuiltHello
  with graceful fallback (clearing PSK on failure rather than aborting)

This enables TLS 1.3 session resumption to work correctly even when the
server sends a HelloRetryRequest, which is common with post-quantum key
exchanges and certain server configurations.
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