You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Fix PSK config validation and handshake edge cases
Review follow-ups to the initial PSK commit, squashed from three
in-flight fixups plus additional validation tightening.
Config validation:
- Reject PSK configs where DTLS 1.2 has no PSK suite after filtering,
regardless of DTLS 1.3 state. The only PSK suite this crate
implements is DTLS 1.2 (0xC0A8), so a surviving DTLS 1.3 suite is
not a fallback for Dtls::new_12_psk; building such a config
produced a runtime-only failure instead of a clear build error.
- Require kx groups whenever a cert-based DTLS 1.2 suite survives
the filter, even when PSK is also configured. Previously a
`with_psk_*().kx_groups(&[])` config that kept ECDHE suites in
the DTLS 1.2 filter built successfully and then failed in
send_server_key_exchange/process_ecdh_params.
- Skip the kx-group check only when the surviving DTLS 1.2 suites
are exclusively PSK, instead of whenever PSK is configured.
- Reject builders whose constructor validation would otherwise
silently accept a PSK-suite-free DTLS 1.2 filter.
Constructor:
- Dtls::new_12_psk asserts the config has a PSK configured so a
missing resolver fails fast at construction rather than producing
zero negotiable suites.
Handshake:
- Omit ServerKeyExchange entirely when the server has no PSK
identity hint configured (RFC 4279 §2).
Docs:
- Clarify that require_client_certificate applies only to
certificate-authenticated cipher suites and has no effect on a
negotiated PSK handshake.
Tests:
- Add psk_with_dtls13_but_no_psk_dtls12_suite_rejected and
psk_with_cert_dtls12_and_empty_kx_groups_rejected to cover the
new validation paths.
- Tighten psk_client_with_empty_kx_groups_builds to an explicitly
PSK-only DTLS 1.2 filter, matching the stricter semantics.
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
0 commit comments