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

refactor: combine TLS1.2 and TLS1.3 sig scheme representations #4498

Merged
merged 6 commits into from
Apr 13, 2024

Conversation

lrstewart
Copy link
Contributor

@lrstewart lrstewart commented Apr 11, 2024

Resolved issues:

Resolves #3916

Description of changes:

Combine the separate TLS1.2 and TLS1.3 ECDSA signature scheme structs into one single struct that can represent both.

This does not change any behavior because:

  • All the policies that only included the TLS1.2 version can't support TLS1.3 anyway.
  • After fix: add missing TLS1.3 p521 sig schemes #4496, all the policies that support TLS1.3 include both versions
  • Combining the TLS1.2 and TLS1.3 versions doesn't lead to a reorder anywhere. I'll comment on the PR where that's non-obvious.

Testing:

Deleted tests related to using duplicate IANAs safely, since we don't have duplicate IANAs anymore :) Added a test to enforce that we don't have any duplicate IANAs.
I also added a self-talk test that uses a different curve/hash for every possible use of a curve/hash, to prove they're all properly independent.

By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.

@github-actions github-actions bot added the s2n-core team label Apr 11, 2024
Comment on lines +379 to -436
/* ECDSA */
&s2n_ecdsa_sha384,

/* RSA PSS - TLS 1.3 */
&s2n_rsa_pss_pss_sha384,

/* ECDSA - TLS 1.2 */
&s2n_ecdsa_sha384, /* same iana value as TLS 1.3 s2n_ecdsa_secp384r1_sha384 */
Copy link
Contributor Author

Choose a reason for hiding this comment

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

It doesn't matter that the TLS1.3 and the TLS1.2 version were separated by RSA-PSS-PSS, because TLS1.2 can't use RSA-PSS-PSS. So s2n_ecdsa_sha384 was always the first TLS1.2 option, and moving it up doesn't change that.

Comment on lines -445 to +393
/* ECDSA - TLS 1.3 */
&s2n_ecdsa_secp384r1_sha384,
/* ECDSA */
&s2n_ecdsa_sha384,
Copy link
Contributor Author

Choose a reason for hiding this comment

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

If you expand the diff, there were no other options between s2n_ecdsa_secp384r1_sha384 and s2n_ecdsa_sha384. Just a big comment.

@lrstewart lrstewart marked this pull request as ready for review April 11, 2024 01:54
@lrstewart lrstewart requested review from goatgoose and jmayclin April 11, 2024 01:54
tests/unit/s2n_signature_algorithms_test.c Show resolved Hide resolved
tests/unit/s2n_signature_algorithms_test.c Outdated Show resolved Hide resolved
tests/unit/s2n_auth_selection_test.c Outdated Show resolved Hide resolved
tests/unit/s2n_auth_selection_test.c Outdated Show resolved Hide resolved
@@ -54,60 +54,6 @@ static S2N_RESULT s2n_test_security_policies_compatible(const struct s2n_securit
return S2N_RESULT_OK;
}

static S2N_RESULT s2n_test_get_missing_duplicate_signature_scheme(
Copy link
Contributor

Choose a reason for hiding this comment

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

🥳

Copy link
Contributor Author

@lrstewart lrstewart Apr 12, 2024

Choose a reason for hiding this comment

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

It served its purpose 😔

tests/unit/s2n_signature_algorithms_test.c Outdated Show resolved Hide resolved
@lrstewart lrstewart requested a review from jmayclin April 12, 2024 22:11
@lrstewart lrstewart enabled auto-merge (squash) April 12, 2024 22:38
@lrstewart lrstewart merged commit 0216a24 into aws:main Apr 13, 2024
32 checks passed
@lrstewart lrstewart deleted the fix_p521 branch April 13, 2024 02:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Duplicate signature algorithm values sent from s2n client
4 participants