-
Notifications
You must be signed in to change notification settings - Fork 711
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
tests: pin tests to a numbered TLS1.2 policy #4905
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. hello request is only supported in TLS1.2 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -759,7 +759,7 @@ int main(int argc, char **argv) | |
struct s2n_connection *conn = NULL; | ||
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_CLIENT)); | ||
EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); | ||
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(conn, "default")); | ||
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(conn, "20240501")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test comment specifies TLS1.2 |
||
|
||
const struct s2n_security_policy *security_policy = NULL; | ||
POSIX_GUARD(s2n_connection_get_security_policy(conn, &security_policy)); | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -78,6 +78,7 @@ int main(int argc, char **argv) | |
S2N_DEFAULT_TEST_CERT_CHAIN, S2N_DEFAULT_TEST_PRIVATE_KEY)); | ||
|
||
DEFER_CLEANUP(struct s2n_config *tls12_config = s2n_config_new(), s2n_config_ptr_free); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(tls12_config, "20240501")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. The name of the config is |
||
EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(tls12_config, chain_and_key)); | ||
EXPECT_SUCCESS(s2n_config_disable_x509_verification(tls12_config)); | ||
EXPECT_SUCCESS(s2n_config_set_serialization_version(tls12_config, S2N_SERIALIZED_CONN_V1)); | ||
|
@@ -594,6 +595,7 @@ int main(int argc, char **argv) | |
/* Self-talk: Test interaction between TLS1.2 session resumption and serialization */ | ||
{ | ||
DEFER_CLEANUP(struct s2n_config *resumption_config = s2n_config_new(), s2n_config_ptr_free); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(resumption_config, "20240501")); | ||
Comment on lines
595
to
+598
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test comment mentions TLS1.2 |
||
EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(resumption_config, chain_and_key)); | ||
EXPECT_SUCCESS(s2n_config_disable_x509_verification(resumption_config)); | ||
EXPECT_SUCCESS(s2n_config_set_serialization_version(resumption_config, S2N_SERIALIZED_CONN_V1)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. EMS supported for TLS1.2 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renegotiation is only supported for TLS1.2 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. renegotiation is only supported for TLS1.2 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Tests are all TLS1.2 specific eg. "Test that we ignore Warning Alerts in S2N_ALERT_IGNORE_WARNINGS mode in TLS1.2" |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -122,7 +122,7 @@ int main(int argc, char **argv) | |
EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER)); | ||
|
||
EXPECT_NOT_NULL(config = s2n_config_new()); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(config, "default")); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(config, "20240501")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test checks for TLS1.2 below |
||
for (int cert = 0; cert < SUPPORTED_CERTIFICATE_FORMATS; cert++) { | ||
EXPECT_SUCCESS(s2n_read_test_pem(certificate_paths[cert], cert_chain_pem, S2N_MAX_TEST_PEM_SIZE)); | ||
EXPECT_SUCCESS(s2n_read_test_pem(private_key_paths[cert], private_key_pem, S2N_MAX_TEST_PEM_SIZE)); | ||
|
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. test comment mentions TLS1.2 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. npn is supported for TLS1.2 |
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test checks that TLS1.2 was negotiated |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1342,7 +1342,7 @@ int main(int argc, char **argv) | |
EXPECT_NOT_NULL(server_conn = s2n_connection_new(S2N_SERVER)); | ||
EXPECT_SUCCESS(s2n_connection_set_blinding(server_conn, S2N_SELF_SERVICE_BLINDING)); | ||
EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config)); | ||
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "default")); | ||
EXPECT_SUCCESS(s2n_connection_set_cipher_preferences(server_conn, "20240501")); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test checks for TLS1.2 below |
||
|
||
EXPECT_SUCCESS(s2n_connections_set_io_pair(client_conn, server_conn, &io_pair)); | ||
EXPECT_SUCCESS(s2n_negotiate_test_server_and_client(server_conn, client_conn)); | ||
|
@@ -1446,13 +1446,15 @@ int main(int argc, char **argv) | |
EXPECT_NOT_NULL(client_configuration); | ||
EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(client_configuration, 1)); | ||
EXPECT_SUCCESS(s2n_config_set_unsafe_for_testing(client_configuration)); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(client_configuration, "20240501")); | ||
|
||
DEFER_CLEANUP(struct s2n_config *server_configuration = s2n_config_new(), | ||
s2n_config_ptr_free); | ||
EXPECT_NOT_NULL(server_configuration); | ||
EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(server_configuration, 1)); | ||
EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(server_configuration, | ||
chain_and_key)); | ||
EXPECT_SUCCESS(s2n_config_set_cipher_preferences(server_configuration, "20240501")); | ||
Comment on lines
+1449
to
+1457
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Test checks for TLS1.2 below |
||
|
||
EXPECT_SUCCESS(s2n_config_add_ticket_crypto_key(server_configuration, ticket_key_name1, | ||
s2n_array_len(ticket_key_name1), ticket_key1, s2n_array_len(ticket_key1), 0)); | ||
|
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.
Test comment mentions TLS1.2