-
Notifications
You must be signed in to change notification settings - Fork 4
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Pre-share key test #138
base: main
Are you sure you want to change the base?
Pre-share key test #138
Changes from all commits
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -602,6 +602,7 @@ fn process_psk_binder_zero_rtt( | |
match (ciphersuite.psk_mode, psko, bindero) { | ||
(true, Some(k), Some(binder)) => { | ||
let mk = derive_binder_key(&ciphersuite.hash, k)?; | ||
let binder = hmac_tag(&ciphersuite.hash, &mk, &th_trunc)?; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why are you recomputing the binder here? This means the HMAC verification on the next line will never fail. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The binder value seemed to be incorrect from the client side, as the value was never tagged. I could not find the correct place to do this call, but you are correct that this will never fail. We should probably add some tests to catch this kind of error. |
||
hmac_verify(&ciphersuite.hash, &mk, &th_trunc, &binder)?; | ||
if ciphersuite.zero_rtt { | ||
let (key_iv, early_exporter_ms) = | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This always returns a zero-length binder. Is that correct?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
No, this is probably not correct. However, it does set the value of the binder, which is then replaced later. So the binder does have the correct value (I think) after processing the client hello. The update should probably be delayed to the point, where we have the binder value, instead of this.