@@ -47,6 +47,7 @@ int mock_client(struct s2n_test_io_pair *io_pair, uint8_t *expected_data, uint32
4747 client_config = s2n_config_new ();
4848 s2n_config_disable_x509_verification (client_config );
4949 s2n_connection_set_config (client_conn , client_config );
50+ GUARD (s2n_config_set_cipher_preferences (client_config , "test_all" ));
5051
5152 s2n_connection_set_io_pair (client_conn , io_pair );
5253
@@ -107,6 +108,7 @@ int mock_client_iov(struct s2n_test_io_pair *io_pair, struct iovec *iov, uint32_
107108 client_config = s2n_config_new ();
108109 s2n_config_disable_x509_verification (client_config );
109110 s2n_connection_set_config (client_conn , client_config );
111+ GUARD (s2n_config_set_cipher_preferences (client_config , "test_all" ));
110112
111113 s2n_connection_set_io_pair (client_conn , io_pair );
112114
@@ -176,16 +178,14 @@ int test_send(int use_tls13, int use_iov, int prefer_throughput)
176178 struct s2n_cert_chain_and_key * chain_and_key ;
177179
178180 EXPECT_NOT_NULL (config = s2n_config_new ());
179- EXPECT_SUCCESS (s2n_read_test_pem (S2N_DEFAULT_TEST_CERT_CHAIN , cert_chain_pem , S2N_MAX_TEST_PEM_SIZE ));
180- EXPECT_SUCCESS (s2n_read_test_pem (S2N_DEFAULT_TEST_PRIVATE_KEY , private_key_pem , S2N_MAX_TEST_PEM_SIZE ));
181+ EXPECT_SUCCESS (s2n_read_test_pem (S2N_DEFAULT_ECDSA_TEST_CERT_CHAIN , cert_chain_pem , S2N_MAX_TEST_PEM_SIZE ));
182+ EXPECT_SUCCESS (s2n_read_test_pem (S2N_DEFAULT_ECDSA_TEST_PRIVATE_KEY , private_key_pem , S2N_MAX_TEST_PEM_SIZE ));
181183 EXPECT_NOT_NULL (chain_and_key = s2n_cert_chain_and_key_new ());
182184 EXPECT_SUCCESS (s2n_cert_chain_and_key_load_pem (chain_and_key , cert_chain_pem , private_key_pem ));
183185 EXPECT_SUCCESS (s2n_config_add_cert_chain_and_key_to_store (config , chain_and_key ));
184186 EXPECT_SUCCESS (s2n_read_test_pem (S2N_DEFAULT_TEST_DHPARAMS , dhparams_pem , S2N_MAX_TEST_PEM_SIZE ));
185187 EXPECT_SUCCESS (s2n_config_add_dhparams (config , dhparams_pem ));
186- if (use_tls13 ) {
187- EXPECT_SUCCESS (s2n_config_set_cipher_preferences (config , "default_tls13" ));
188- }
188+ GUARD (s2n_config_set_cipher_preferences (config , "test_all" ));
189189
190190 /* Get some random data to send/receive */
191191 uint32_t data_size = 0 ;
@@ -264,6 +264,13 @@ int test_send(int use_tls13, int use_iov, int prefer_throughput)
264264 /* Negotiate the handshake. */
265265 EXPECT_SUCCESS (s2n_negotiate (conn , & blocked ));
266266
267+ /* Make sure we negotiated the expected version */
268+ if (use_tls13 ) {
269+ EXPECT_EQUAL (conn -> actual_protocol_version , S2N_TLS13 );
270+ } else {
271+ EXPECT_EQUAL (conn -> actual_protocol_version , S2N_TLS12 );
272+ }
273+
267274 /* Pause the child process by sending it SIGSTP */
268275 EXPECT_SUCCESS (kill (pid , SIGSTOP ));
269276
@@ -354,9 +361,6 @@ int main(int argc, char **argv)
354361 EXPECT_NOT_NULL (dhparams_pem = malloc (S2N_MAX_TEST_PEM_SIZE ));
355362
356363 for (int use_tls13 = 0 ; use_tls13 < 2 ; use_tls13 ++ ) {
357- if (use_tls13 && !s2n_is_tls13_supported ()) {
358- continue ;
359- }
360364 for (int use_iovec = 0 ; use_iovec < 2 ; use_iovec ++ ) {
361365 for (int use_throughput = 0 ; use_throughput < 2 ; use_throughput ++ ) {
362366 test_send (use_tls13 , use_iovec , use_throughput );
0 commit comments