Reject second ClientHello that withdraws PSK offer - #3259
Conversation
fc2f24f to
10dca06
Compare
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #3259 +/- ##
==========================================
+ Coverage 95.35% 95.36% +0.01%
==========================================
Files 99 99
Lines 23570 23624 +54
Branches 677 679 +2
==========================================
+ Hits 22474 22529 +55
+ Misses 940 939 -1
Partials 156 156 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
djc
left a comment
There was a problem hiding this comment.
Thanks! Is there bogo coverage for this?
Benchmark resultsInstruction countsSignificant differencesClick to expand
Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Memory usageKey:
Significant differencesThere are no significant memory usage differences Additional informationCheckout details:
|
|
Yes. It is the test the change came from: without the check the shim finishes a full handshake with a HelloRetryRequest instead of sending |
|
Ugh, not sure why I missed that. Thanks, I think this looks good but will wait for one more maintainer to have a look. |
cpu
left a comment
There was a problem hiding this comment.
Thanks! Seems reasonable to me. I had two very minor comment nits to consider.
10dca06 to
d53de85
Compare
d53de85 to
f8273ac
Compare
|
Pushed the RFC number update just now. Thanks! |
RFC 8446 §4.1.2 lists exhaustively what a client may change in its second ClientHello after a HelloRetryRequest. A
pre_shared_keyextension may be updated there (recomputing the binders, adjusting the obfuscated ticket age, and optionally dropping PSKs incompatible with the server's chosen cipher suite), but withdrawing the extension altogether is not one of the permitted changes.We accepted that anyway.
ExpectClientHellokept no record of whether the first ClientHello carried a PSK offer, so a second hello that omitted the extension was handled as if the client had never offered a PSK at all.This PR:
PeerMisbehaved::MissingPskExtensionInSecondClientHello, which maps to amissing_extensionalertExpectClientHello::offered_psk_before_retrywhen emitting the HelloRetryRequest, and rejects a second hello that drops it inclient_hello::handle_client_helloResume-Server-OmitAllPSKsOnSecondClientHello, which was disabled with aTODOreason