-
Notifications
You must be signed in to change notification settings - Fork 708
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
Clean up receiving peer sig alg #4259
Merged
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
lrstewart
force-pushed
the
sig_schemes_3
branch
from
October 24, 2023 02:01
0d952a8
to
bd2e619
Compare
maddeleine
reviewed
Oct 25, 2023
goatgoose
reviewed
Oct 25, 2023
goatgoose
approved these changes
Oct 26, 2023
maddeleine
approved these changes
Oct 26, 2023
goatgoose
approved these changes
Oct 27, 2023
5 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Resolved issues:
related to #4257
Description of changes:
The next small cleanup: refactor how we receive the signature algorithm the peer selects.
The main change here is that we move the pre-TLS1.2 default logic to s2n_signature_algorithms.c. Before it was duplicated across all the files that called into s2n_signature_algorithms.c. I also rename some functions and switch to s2n_result.
Call-outs:
At the moment, s2n_signature_algorithms_get_legacy_default partially duplicates s2n_choose_default_sig_scheme. s2n_choose_default_sig_scheme will go away in the next PR: it mixes together the pre-TLS1.2 default logic, the TLS1.2 logic for defaults if no signature_algorithms are given, and our custom TLS1.2 and TLS1.3 fallback logic. This mix is confusing and prone to errors. So for now, the new code uses the simpler and more narrowly scoped s2n_signature_algorithms_get_legacy_default, which only deals with pre-TLS1.2 defaults. We only need to deal with pre-TLS1.2 defaults because the peer only doesn't explicitly specify the chosen signature algorithm for <TLS1.2.
I'm actually pretty proud of what I replace s2n_choose_default_sig_scheme with in the next PR, so I promise no duplication long-term.
Testing:
Existing tests pass. Added some new unit tests.
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.