Skip to content
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

Echo session_id in HRR #1374

Merged
merged 4 commits into from
Jul 26, 2023
Merged

Echo session_id in HRR #1374

merged 4 commits into from
Jul 26, 2023

Conversation

ctz
Copy link
Member

@ctz ctz commented Jul 26, 2023

On the server, we should've been echoing the session_id in HelloRetryRequest messages (we already did for ServerHellos).

On the client, there's a requirement that we detect this and fail the connection with an illegal_parameter alert.

fixes #1373

@codecov
Copy link

codecov bot commented Jul 26, 2023

Codecov Report

Merging #1374 (5f9dcde) into main (304116b) will increase coverage by 0.00%.
The diff coverage is 100.00%.

@@           Coverage Diff           @@
##             main    #1374   +/-   ##
=======================================
  Coverage   96.35%   96.35%           
=======================================
  Files          62       62           
  Lines       14554    14581   +27     
=======================================
+ Hits        14023    14050   +27     
  Misses        531      531           
Files Changed Coverage Δ
rustls/src/error.rs 97.33% <ø> (ø)
rustls/src/client/hs.rs 97.05% <100.00%> (+0.10%) ⬆️
rustls/src/server/tls13.rs 96.96% <100.00%> (+<0.01%) ⬆️
rustls/src/verify.rs 93.12% <100.00%> (+0.04%) ⬆️

📣 We’re building smart automated test selection to slash your CI/CD build times. Learn more

Copy link
Member

@djc djc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I wonder if this is something I regressed in the 0.20 times...

rustls/src/client/hs.rs Show resolved Hide resolved
rustls/src/server/tls13.rs Outdated Show resolved Hide resolved
@ctz
Copy link
Member Author

ctz commented Jul 26, 2023

I wonder if this is something I regressed in the 0.20 times...

It's not, but was a late addition in TLS1.3 (introduced in draft 22) so got overlooked.

@ctz ctz force-pushed the jbp-echo-session-id-in-hrr branch from 66ea868 to 5f9dcde Compare July 26, 2023 15:26
@ctz ctz enabled auto-merge July 26, 2023 15:31
@ctz ctz added this pull request to the merge queue Jul 26, 2023
Merged via the queue into main with commit cc19eab Jul 26, 2023
39 checks passed
@ctz ctz deleted the jbp-echo-session-id-in-hrr branch July 26, 2023 15:37
@cpu
Copy link
Member

cpu commented Jul 26, 2023

It's not, but was a late addition in TLS1.3 (introduced in draft 22) so got overlooked.

Maybe that helps explain why BoGo doesn't have coverage for this too? 🤕

@davidben
Copy link

davidben commented Sep 1, 2023

Maybe that helps explain why BoGo doesn't have coverage for this too? 🤕

No, just an oversight / didn't occur to us that someone might mess this up. (If you think about what a TLS-1.2-expecting middlebox might do, any workarounds naturally need to equally apply to ServerHello and HelloRetryRequest. When implementing the compat mode, you need to keep this in mind.)

I'll see about adding a test.

davidben added a commit to google/boringssl that referenced this pull request Sep 1, 2023
We have a corresponding check on the ServerHello, but not
HelloRetryRequest. See also rustls/rustls#1374,
where rustls forgot to apply the compatibility logic to
HelloRetryRequest.

(From the perspective of a TLS-1.2-expecting observer, HelloRetryRequest
is the ServerHello, so encoding hacks need to apply to both.)

Change-Id: I9b711ea45c54770a76ecfbca8bc992a4eaef6fcd
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62906
Reviewed-by: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
justsmth pushed a commit to justsmth/aws-lc that referenced this pull request Feb 12, 2024
We have a corresponding check on the ServerHello, but not
HelloRetryRequest. See also rustls/rustls#1374,
where rustls forgot to apply the compatibility logic to
HelloRetryRequest.

(From the perspective of a TLS-1.2-expecting observer, HelloRetryRequest
is the ServerHello, so encoding hacks need to apply to both.)

Change-Id: I9b711ea45c54770a76ecfbca8bc992a4eaef6fcd
Reviewed-on: https://boringssl-review.googlesource.com/c/boringssl/+/62906
Reviewed-by: Adam Langley <agl@google.com>
Auto-Submit: David Benjamin <davidben@google.com>
Commit-Queue: Adam Langley <agl@google.com>
(cherry picked from commit 9404a0b6c98e049094929db483634210560d31fb)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Rustls server aborts TLS 1.3 connection if OpenSSL client prefers P-521
4 participants