-
Notifications
You must be signed in to change notification settings - Fork 741
client: reject TLS 1.3 compat session ID in 1.2 #2360
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
Conversation
@@ -17,7 +17,6 @@ | |||
"CheckLeafCurve": "", | |||
"SendWarningAlerts-*": "", | |||
"Peek-*": "", | |||
"EchoTLS13CompatibilitySessionID": "", |
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.
It looks like this ignore was added way back in 2018 (32eeec6) without any special mention.
I was looking at the test case for other reasons and couldn't think of a reason why we shouldn't add the coverage. WDYT?
rustls/src/error.rs
Outdated
@@ -281,6 +281,7 @@ pub enum PeerMisbehaved { | |||
UnsolicitedServerHelloExtension, | |||
WrongGroupForKeyShare, | |||
UnsolicitedEchExtension, | |||
ServerEchoedCompatibilitySessionId, |
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.
I initially added this in alpha-order, but the semver compat check job doesn't like a new value being sliced in even though this is non-exhaustive
because:
This breaks downstream code that used its value via a numeric cast like
as isize
.
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.
Pff, not sure we should listen to it on that.
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.
I put it back in sorted position for now and can revisit if someone feels strongly about maintaining the numeric values.
Cool -- how did you find this? |
Codecov ReportAll modified and coverable lines are covered by tests ✅
Additional details and impacted files@@ Coverage Diff @@
## main #2360 +/- ##
=======================================
Coverage 94.89% 94.89%
=======================================
Files 103 103
Lines 24532 24548 +16
=======================================
+ Hits 23280 23296 +16
Misses 1252 1252 ☔ View full report in Codecov by Sentry. |
In $JOB_HOURS I'm working through the Go standard library's equivalent BoGo skip list trying to improve coverage. I have a similar change open there after thinking through the testcase. Where possible I've been trying to (in volunteer time) bring useful changes like this and #2347 back here 🤝 |
Benchmark resultsInstruction countsSignificant differencesThere are no significant instruction count differences Other differencesClick to expand
Wall-timeSignificant differencesThere are no significant wall-time differences Other differencesClick to expand
Additional informationCheckout details:
|
If the client hello input had no resuming session, but has a non-empty SessionId, it means we generated a TLS 1.3 legacy_session_id for middle-box compatibility purposes. In this case if we end up handshaking for TLS 1.2 we should ensure the server didn't echo the session ID back to us. Since it was invented at random to fill the need of a non-empty value it should never be a recognized server session.
51eef44
to
c414bfc
Compare
If the client hello input had no resuming session, but has a non-empty SessionId, it means we generated a TLS 1.3 legacy_session_id for middle-box compatibility purposes.
In this case if we end up handshaking for TLS 1.2 we should ensure the server didn't echo the session ID back to us. Since it was invented at random to fill the need of a non-empty value it should never be a recognized server session.