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

test: pin optional client auth test to a TLS 1.2 policy #4914

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

toidiu
Copy link
Contributor

@toidiu toidiu commented Nov 19, 2024

#4765

Description of changes:

Pin tests in s2n_optional_client_auth_test to a TLS 1.2 security policy.

Callout:

Why do we need this change?
These tests iterate thru all ciphers in the security policy and attempt a handshake. Currently all ciphers in the security policy are able to negotiate TLS1.2. When we introduce TLS 1.3 support to the default policy (by adding TLS1.3 ciphers), s2n_disable_tls13_in_test() will work by setting the s2n_highest_protocol_version to TLS1.2 to prevent negotiating TLS1.3.

However, TLS1.3 only ciphers are not able to negotiate TLS1.2, causing the tests to fail.

/* Verify that a handshake succeeds for every cipher in the default list. */
  for (int cipher_idx = 0; cipher_idx < default_cipher_preferences->count; cipher_idx++) {

Testing:

Existing tests should continue to pass.

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 Nov 19, 2024
Comment on lines -38 to +45
EXPECT_SUCCESS(s2n_disable_tls13_in_test());

EXPECT_NOT_NULL(cert_chain_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
EXPECT_NOT_NULL(private_key_pem = malloc(S2N_MAX_TEST_PEM_SIZE));
EXPECT_NOT_NULL(dhparams_pem = malloc(S2N_MAX_TEST_PEM_SIZE));

/* Setup baseline server config and certs. */
EXPECT_NOT_NULL(server_config = s2n_config_new());
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(server_config, "20240501"));
Copy link
Contributor Author

@toidiu toidiu Nov 19, 2024

Choose a reason for hiding this comment

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

This is a safe change because by calling s2n_disable_tls13_in_test() these tests assume a TLS1.2 policy today.

@toidiu toidiu enabled auto-merge (squash) November 20, 2024 22:02
@toidiu toidiu merged commit 72ae26d into aws:main Nov 21, 2024
38 checks passed
@toidiu toidiu deleted the ak-pinUnit2 branch November 21, 2024 17:08
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.

3 participants