From 0d084bdca892427825c9056d7241e5209db4171d Mon Sep 17 00:00:00 2001 From: Jou Ho Date: Mon, 15 Apr 2024 22:19:29 +0000 Subject: [PATCH 1/2] fix redundant code --- tests/unit/s2n_client_psk_extension_test.c | 34 ++--------- tests/unit/s2n_psk_offered_test.c | 26 +-------- .../s2n_self_talk_session_resumption_test.c | 28 +--------- .../unit/s2n_server_new_session_ticket_test.c | 56 ++++++------------- .../unit/s2n_tls13_new_session_ticket_test.c | 26 +-------- 5 files changed, 27 insertions(+), 143 deletions(-) diff --git a/tests/unit/s2n_client_psk_extension_test.c b/tests/unit/s2n_client_psk_extension_test.c index 5f89b493b4a..b4106154df2 100644 --- a/tests/unit/s2n_client_psk_extension_test.c +++ b/tests/unit/s2n_client_psk_extension_test.c @@ -74,28 +74,6 @@ static int mock_time(void *data, uint64_t *nanoseconds) return S2N_SUCCESS; } -static int s2n_setup_ticket_key(struct s2n_config *config) -{ - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba63" - "90b6c73bb50f9c3122ec844ad7c2b3e5"); - - /* Set up encryption key */ - uint64_t current_time = 0; - uint8_t ticket_key_name[16] = "2016.07.26.15\0"; - - POSIX_GUARD(s2n_config_set_session_tickets_onoff(config, 1)); - POSIX_GUARD(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - POSIX_GUARD(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); - return S2N_SUCCESS; -} - static S2N_RESULT s2n_setup_encrypted_ticket(struct s2n_connection *conn, struct s2n_stuffer *output) { conn->tls13_ticket_fields = (struct s2n_ticket_fields){ 0 }; @@ -701,7 +679,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -736,7 +714,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -809,7 +787,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -1044,11 +1022,11 @@ int main(int argc, char **argv) EXPECT_NOT_NULL(config_with_cb); uint16_t expected_wire_choice = 0; EXPECT_SUCCESS(s2n_config_set_psk_selection_callback(config_with_cb, s2n_test_select_psk_identity_callback, &expected_wire_choice)); - EXPECT_SUCCESS(s2n_setup_ticket_key(config_with_cb)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config_with_cb)); struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); @@ -1549,7 +1527,7 @@ int main(int argc, char **argv) EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(config, chain_and_key)); EXPECT_SUCCESS(s2n_config_set_cipher_preferences(config, "default_tls13")); EXPECT_SUCCESS(s2n_config_disable_x509_verification(config)); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); DEFER_CLEANUP(struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER), s2n_connection_ptr_free); diff --git a/tests/unit/s2n_psk_offered_test.c b/tests/unit/s2n_psk_offered_test.c index de01cd25b1e..8e039b7c61c 100644 --- a/tests/unit/s2n_psk_offered_test.c +++ b/tests/unit/s2n_psk_offered_test.c @@ -22,28 +22,6 @@ #define MILLIS_TO_NANOS(millis) (millis * (uint64_t) ONE_MILLISEC_IN_NANOS) -static int s2n_setup_ticket_key(struct s2n_config *config) -{ - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba63" - "90b6c73bb50f9c3122ec844ad7c2b3e5"); - - /* Set up encryption key */ - uint64_t current_time = 0; - uint8_t ticket_key_name[16] = "2016.07.26.15\0"; - - POSIX_GUARD(s2n_config_set_session_tickets_onoff(config, 1)); - POSIX_GUARD(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - POSIX_GUARD(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); - return S2N_SUCCESS; -} - static S2N_RESULT s2n_setup_encrypted_ticket(struct s2n_connection *conn, struct s2n_stuffer *output) { conn->tls13_ticket_fields = (struct s2n_ticket_fields){ 0 }; @@ -470,7 +448,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config)); server_conn->psk_params.type = S2N_PSK_TYPE_RESUMPTION; @@ -509,7 +487,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config)); server_conn->psk_params.type = S2N_PSK_TYPE_RESUMPTION; diff --git a/tests/unit/s2n_self_talk_session_resumption_test.c b/tests/unit/s2n_self_talk_session_resumption_test.c index 11c5cfad052..6b5621baa1c 100644 --- a/tests/unit/s2n_self_talk_session_resumption_test.c +++ b/tests/unit/s2n_self_talk_session_resumption_test.c @@ -88,30 +88,6 @@ static int s2n_test_session_ticket_cb(struct s2n_connection *conn, void *ctx, st return S2N_SUCCESS; } -static int s2n_setup_test_ticket_key(struct s2n_config *config) -{ - POSIX_ENSURE_REF(config); - - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba63" - "90b6c73bb50f9c3122ec844ad7c2b3e5"); - - /* Set up encryption key */ - uint64_t current_time = 0; - uint8_t ticket_key_name[16] = "2016.07.26.15\0"; - EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); - EXPECT_SUCCESS(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - EXPECT_SUCCESS(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); - - return S2N_SUCCESS; -} - static S2N_RESULT s2n_test_issue_new_session_ticket(struct s2n_connection *server_conn, struct s2n_connection *client_conn, const struct s2n_early_data_test_case *early_data_case) { @@ -248,7 +224,7 @@ int main(int argc, char **argv) S2N_DEFAULT_ECDSA_TEST_PRIVATE_KEY)); EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(server_config, tls13_chain_and_key)); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(server_config, true)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(server_config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(server_config)); /* Setup TLS1.2 server config */ struct s2n_config *tls12_server_config = s2n_config_new(); @@ -260,7 +236,7 @@ int main(int argc, char **argv) S2N_DEFAULT_TEST_PRIVATE_KEY)); EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(tls12_server_config, tls12_chain_and_key)); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(tls12_server_config, true)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(tls12_server_config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(tls12_server_config)); /* Setup TLS1.3 client config */ struct s2n_config *tls13_client_config = s2n_config_new(); diff --git a/tests/unit/s2n_server_new_session_ticket_test.c b/tests/unit/s2n_server_new_session_ticket_test.c index b299964fefc..49fb0eb04f5 100644 --- a/tests/unit/s2n_server_new_session_ticket_test.c +++ b/tests/unit/s2n_server_new_session_ticket_test.c @@ -58,30 +58,6 @@ static int s2n_test_session_ticket_cb(struct s2n_connection *conn, void *ctx, st return S2N_SUCCESS; } -static int s2n_setup_test_ticket_key(struct s2n_config *config) -{ - POSIX_ENSURE_REF(config); - - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba63" - "90b6c73bb50f9c3122ec844ad7c2b3e5"); - - /* Set up encryption key */ - uint64_t current_time = 0; - uint8_t ticket_key_name[16] = "2016.07.26.15\0"; - EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); - EXPECT_SUCCESS(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - EXPECT_SUCCESS(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); - - return S2N_SUCCESS; -} - static int s2n_setup_test_resumption_secret(struct s2n_connection *conn) { POSIX_ENSURE_REF(conn); @@ -117,7 +93,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_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -189,7 +165,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_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -219,7 +195,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_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -261,7 +237,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(conn); @@ -300,7 +276,7 @@ int main(int argc, char **argv) EXPECT_NOT_NULL(config); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); EXPECT_SUCCESS(s2n_config_set_session_ticket_cb(config, s2n_test_session_ticket_cb, NULL)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *server_conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(server_conn); @@ -655,7 +631,7 @@ int main(int argc, char **argv) EXPECT_NOT_NULL(server_conn); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config)); EXPECT_SUCCESS(s2n_config_set_session_ticket_cb(config, s2n_test_session_ticket_cb, NULL)); @@ -688,7 +664,7 @@ int main(int argc, char **argv) EXPECT_NOT_NULL(config); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); EXPECT_SUCCESS(s2n_config_set_session_ticket_cb(config, s2n_test_session_ticket_cb, NULL)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(client_conn); @@ -726,7 +702,7 @@ int main(int argc, char **argv) EXPECT_NOT_NULL(config); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); EXPECT_SUCCESS(s2n_config_set_session_ticket_cb(config, s2n_test_session_ticket_cb, NULL)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *client_conn = s2n_connection_new(S2N_CLIENT); EXPECT_NOT_NULL(client_conn); @@ -854,7 +830,7 @@ int main(int argc, char **argv) DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_SERVER), s2n_connection_ptr_free); @@ -882,7 +858,7 @@ int main(int argc, char **argv) { struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(conn); @@ -916,7 +892,7 @@ int main(int argc, char **argv) DEFER_CLEANUP(struct s2n_config *config = s2n_config_new(), s2n_config_ptr_free); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); DEFER_CLEANUP(struct s2n_connection *conn = s2n_connection_new(S2N_SERVER), s2n_connection_ptr_free); @@ -949,7 +925,7 @@ int main(int argc, char **argv) struct s2n_connection *conn = NULL; EXPECT_NOT_NULL(conn = s2n_connection_new(S2N_SERVER)); EXPECT_NOT_NULL(config = s2n_config_new()); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -998,7 +974,7 @@ int main(int argc, char **argv) struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(conn); @@ -1135,7 +1111,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_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(conn, config)); conn->actual_protocol_version = S2N_TLS13; @@ -1176,7 +1152,7 @@ int main(int argc, char **argv) { struct s2n_config *config = s2n_config_new(); EXPECT_NOT_NULL(config); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); struct s2n_connection *conn = s2n_connection_new(S2N_SERVER); EXPECT_NOT_NULL(conn); @@ -1285,7 +1261,7 @@ int main(int argc, char **argv) EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); EXPECT_SUCCESS(s2n_connection_set_config(client_conn, config)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); EXPECT_SUCCESS(s2n_connection_set_config(server_conn, config)); uint16_t tickets_to_send = 5; diff --git a/tests/unit/s2n_tls13_new_session_ticket_test.c b/tests/unit/s2n_tls13_new_session_ticket_test.c index 627299e7214..2e7dafb48cd 100644 --- a/tests/unit/s2n_tls13_new_session_ticket_test.c +++ b/tests/unit/s2n_tls13_new_session_ticket_test.c @@ -46,29 +46,6 @@ static int s2n_test_session_ticket_cb(struct s2n_connection *conn, void *ctx, st return S2N_SUCCESS; } -static int s2n_setup_test_ticket_key(struct s2n_config *config) -{ - POSIX_ENSURE_REF(config); - - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba63" - "90b6c73bb50f9c3122ec844ad7c2b3e5"); - - /* Set up encryption key */ - uint64_t current_time = 0; - uint8_t ticket_key_name[S2N_TICKET_KEY_NAME_LEN] = "2016.07.26.15\0"; - EXPECT_SUCCESS(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - EXPECT_SUCCESS(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); - - return S2N_SUCCESS; -} - int main(int argc, char **argv) { BEGIN_TEST(); @@ -93,9 +70,8 @@ int main(int argc, char **argv) struct s2n_cert_chain_and_key *chain_and_key = NULL; EXPECT_SUCCESS(s2n_test_cert_chain_and_key_new(&chain_and_key, S2N_DEFAULT_ECDSA_TEST_CERT_CHAIN, S2N_DEFAULT_ECDSA_TEST_PRIVATE_KEY)); - EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(server_config, 1)); EXPECT_SUCCESS(s2n_config_add_cert_chain_and_key_to_store(server_config, chain_and_key)); - EXPECT_SUCCESS(s2n_setup_test_ticket_key(server_config)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(server_config)); EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(client_config, 1)); EXPECT_SUCCESS(s2n_config_set_session_ticket_cb(client_config, s2n_test_session_ticket_cb, NULL)); From e2166d3e2ff360fac0d5cf5f2bd95d9c0cd7f4aa Mon Sep 17 00:00:00 2001 From: Jou Ho Date: Mon, 15 Apr 2024 23:14:47 +0000 Subject: [PATCH 2/2] replace setup with a pre-defined function --- tests/unit/s2n_extended_master_secret_test.c | 15 +-------------- 1 file changed, 1 insertion(+), 14 deletions(-) diff --git a/tests/unit/s2n_extended_master_secret_test.c b/tests/unit/s2n_extended_master_secret_test.c index c112114fa64..2541c203598 100644 --- a/tests/unit/s2n_extended_master_secret_test.c +++ b/tests/unit/s2n_extended_master_secret_test.c @@ -24,21 +24,8 @@ int main(int argc, char **argv) /* Test s2n_conn_set_handshake_type is processing EMS data correctly */ { struct s2n_config *config = NULL; - uint64_t current_time = 0; EXPECT_NOT_NULL(config = s2n_config_new()); - - EXPECT_SUCCESS(s2n_config_set_session_tickets_onoff(config, 1)); - EXPECT_SUCCESS(config->wall_clock(config->sys_clock_ctx, ¤t_time)); - uint8_t ticket_key_name[16] = "2016.07.26.15\0"; - /** - *= https://tools.ietf.org/rfc/rfc5869#appendix-A.1 - *# PRK = 0x077709362c2e32df0ddc3f0dc47bba63 - *# 90b6c73bb50f9c3122ec844ad7c2b3e5 (32 octets) - **/ - S2N_BLOB_FROM_HEX(ticket_key, - "077709362c2e32df0ddc3f0dc47bba6390b6c73bb50f9c3122ec844ad7c2b3e5"); - EXPECT_SUCCESS(s2n_config_add_ticket_crypto_key(config, ticket_key_name, strlen((char *) ticket_key_name), - ticket_key.data, ticket_key.size, current_time / ONE_SEC_IN_NANOS)); + EXPECT_OK(s2n_resumption_test_ticket_key_setup(config)); /** *= https://tools.ietf.org/rfc/rfc7627#section-5.3