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
{{ message }}
Repository navigation
V2ClientHello first_packet check is slightly off #1298
But not for V2ClientHello. The peer might send a handshake record containing the first byte of a (V3) ClientHello, followed by a V2ClientHello. I haven't tried this, but by inspection I believe the current logic would accept such an input and get a little confused.
To clarify, this difference is because handshake messages may be fragmented. The first message may span the first several records if the peer is being obnoxious.
(This only affects the master branch. 1.0.x uses a very different V2ClientHello mechanism.)
Checking s->init_num in the low-level record logic seems kind of a layering violation. And indeed you all also needed to check the empty record count which is weird. Come to think of it, I think you missed another case: what if you got a warning alert before the V2ClientHello?
Why not add a is_first_record bit? Checking the recv sequence number + asserting we're in the unencrypted epoch is probably also reasonable.
It should also be easy to write tests for this. (Hrm. We don't have test like this. I'll go fix that...)
Activity
davidben commentedon Jul 11, 2016
To clarify, this difference is because handshake messages may be fragmented. The first message may span the first several records if the peer is being obnoxious.
(This only affects the master branch. 1.0.x uses a very different V2ClientHello mechanism.)
Make the checks for an SSLv2 style record stricter
mattcaswell commentedon Jul 29, 2016
Should be fixed in 0647719.
davidben commentedon Jul 29, 2016
Checking
s->init_numin the low-level record logic seems kind of a layering violation. And indeed you all also needed to check the empty record count which is weird. Come to think of it, I think you missed another case: what if you got a warning alert before the V2ClientHello?Why not add a
is_first_recordbit? Checking the recv sequence number + asserting we're in the unencrypted epoch is probably also reasonable.It should also be easy to write tests for this. (Hrm. We don't have test like this. I'll go fix that...)
davidben commentedon Jul 29, 2016
Okay, if you patch these into https://github.com/google/openssl-tests, it might work for verifying this?
https://boringssl-review.googlesource.com/c/9040/
(Probably worth a test for server renego too. I didn't add that one because we never accept renegotiations as a server.)
Test that V2ClientHello must be the first record.
richsalz commentedon Aug 1, 2016
ping @mattcaswell
mattcaswell commentedon Aug 1, 2016
See #1374
Address feedback on SSLv2 ClientHello processing
Address feedback on SSLv2 ClientHello processing
mattcaswell commentedon Aug 15, 2016
Fixed.