diff options
Diffstat (limited to 'test/core/tsi')
-rw-r--r-- | test/core/tsi/ssl_transport_security_test.cc | 13 | ||||
-rw-r--r-- | test/core/tsi/transport_security_test.cc | 39 | ||||
-rw-r--r-- | test/core/tsi/transport_security_test_lib.cc | 9 |
3 files changed, 35 insertions, 26 deletions
diff --git a/test/core/tsi/ssl_transport_security_test.cc b/test/core/tsi/ssl_transport_security_test.cc index 03367d85e5..8939c0434b 100644 --- a/test/core/tsi/ssl_transport_security_test.cc +++ b/test/core/tsi/ssl_transport_security_test.cc @@ -125,8 +125,9 @@ static void ssl_test_setup_handshakers(tsi_test_fixture* fixture) { key_cert_lib->use_bad_server_cert ? key_cert_lib->bad_server_num_key_cert_pairs : key_cert_lib->server_num_key_cert_pairs, - key_cert_lib->root_cert, ssl_fixture->force_client_auth, nullptr, - (const char**)server_alpn_protocols, num_server_alpn_protocols, + key_cert_lib->root_cert, ssl_fixture->force_client_auth, + nullptr, (const char**)server_alpn_protocols, + num_server_alpn_protocols, &ssl_fixture->server_handshaker_factory) == TSI_OK); /* Create server and client handshakers. */ tsi_handshaker* client_handshaker = nullptr; @@ -565,8 +566,8 @@ void test_tsi_ssl_client_handshaker_factory_refcounting() { tsi_ssl_client_handshaker_factory* client_handshaker_factory; GPR_ASSERT(tsi_create_ssl_client_handshaker_factory( - nullptr, cert_chain, nullptr, nullptr, 0, &client_handshaker_factory) == - TSI_OK); + nullptr, cert_chain, nullptr, nullptr, 0, + &client_handshaker_factory) == TSI_OK); handshaker_factory_destructor_called = false; original_vtable = tsi_ssl_handshaker_factory_swap_vtable( @@ -644,8 +645,8 @@ void test_tsi_ssl_client_handshaker_factory_bad_params() { tsi_ssl_client_handshaker_factory* client_handshaker_factory; GPR_ASSERT(tsi_create_ssl_client_handshaker_factory( - nullptr, cert_chain, nullptr, nullptr, 0, &client_handshaker_factory) == - TSI_INVALID_ARGUMENT); + nullptr, cert_chain, nullptr, nullptr, 0, + &client_handshaker_factory) == TSI_INVALID_ARGUMENT); tsi_ssl_client_handshaker_factory_unref(client_handshaker_factory); } diff --git a/test/core/tsi/transport_security_test.cc b/test/core/tsi/transport_security_test.cc index 8dfe72e03b..c788ad96ad 100644 --- a/test/core/tsi/transport_security_test.cc +++ b/test/core/tsi/transport_security_test.cc @@ -90,7 +90,8 @@ const cert_name_test_entry cert_name_test_entries[] = { /* IDN tests */ {1, "xn--poema-9qae5a.com.br", "xn--poema-9qae5a.com.br", nullptr, nullptr}, - {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, + {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, + nullptr}, {0, "xn--poema-9qae5a.com.br", "", "*.xn--poema-9qae5a.com.br," "xn--poema-*.com.br," @@ -129,8 +130,10 @@ const cert_name_test_entry cert_name_test_entries[] = { {0, "foo", "*", nullptr, nullptr}, /* IDN variants of wildcards and registry controlled domains. */ - {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, nullptr}, - {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", nullptr, nullptr}, + {1, "www.xn--poema-9qae5a.com.br", "*.xn--poema-9qae5a.com.br", nullptr, + nullptr}, + {1, "test.example.xn--mgbaam7a8h", "*.example.xn--mgbaam7a8h", nullptr, + nullptr}, /* {0, "xn--poema-9qae5a.com.br", "*.com.br", NULL}, */ @@ -177,7 +180,8 @@ const cert_name_test_entry cert_name_test_entries[] = { {1, "173.194.195.139", "foo.example.com", nullptr, "173.194.195.139"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8"}, {0, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8,8.8.4.4"}, - {1, "173.194.195.139", "foo.example.com", nullptr, "8.8.8.8,173.194.195.139"}, + {1, "173.194.195.139", "foo.example.com", nullptr, + "8.8.8.8,173.194.195.139"}, {0, "173.194.195.139", "foo.example.com", nullptr, "173.194.195.13"}, {0, "2001:db8:a0b:12f0::1", "foo.example.com", nullptr, "173.194.195.13"}, {1, "2001:db8:a0b:12f0::1", "foo.example.com", nullptr, @@ -344,25 +348,26 @@ static void test_result_strings(void) { } static void test_protector_invalid_args(void) { - GPR_ASSERT(tsi_frame_protector_protect(nullptr, nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_frame_protector_protect_flush(nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_frame_protector_unprotect(nullptr, nullptr, nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_protect(nullptr, nullptr, nullptr, nullptr, + nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_protect_flush( + nullptr, nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_frame_protector_unprotect(nullptr, nullptr, nullptr, nullptr, + nullptr) == TSI_INVALID_ARGUMENT); } static void test_handshaker_invalid_args(void) { GPR_ASSERT(tsi_handshaker_get_result(nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_extract_peer(nullptr, nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_create_frame_protector(nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_process_bytes_from_peer(nullptr, nullptr, nullptr) == + GPR_ASSERT(tsi_handshaker_extract_peer(nullptr, nullptr) == TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer(nullptr, nullptr, nullptr) == - TSI_INVALID_ARGUMENT); - GPR_ASSERT(tsi_handshaker_next(nullptr, nullptr, 0, nullptr, nullptr, nullptr, nullptr, nullptr) == + GPR_ASSERT(tsi_handshaker_create_frame_protector(nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_process_bytes_from_peer( + nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_get_bytes_to_send_to_peer( + nullptr, nullptr, nullptr) == TSI_INVALID_ARGUMENT); + GPR_ASSERT(tsi_handshaker_next(nullptr, nullptr, 0, nullptr, nullptr, nullptr, + nullptr, nullptr) == TSI_INVALID_ARGUMENT); } static void test_handshaker_invalid_state(void) { diff --git a/test/core/tsi/transport_security_test_lib.cc b/test/core/tsi/transport_security_test_lib.cc index 47a71717a6..3537366de9 100644 --- a/test/core/tsi/transport_security_test_lib.cc +++ b/test/core/tsi/transport_security_test_lib.cc @@ -110,7 +110,8 @@ static void check_handshake_results(tsi_test_fixture* fixture) { fixture->vtable->check_handshaker_peers(fixture); /* Check unused bytes. */ if (fixture->test_unused_bytes) { - if (fixture->server_result != nullptr && fixture->client_result != nullptr) { + if (fixture->server_result != nullptr && + fixture->client_result != nullptr) { check_unused_bytes(fixture); } fixture->bytes_written_to_server_channel = 0; @@ -145,7 +146,8 @@ static void maybe_append_unused_bytes(handshaker_args* args) { args->appended_unused_bytes = true; send_bytes_to_peer(fixture, (const unsigned char*)TSI_TEST_UNUSED_BYTES, strlen(TSI_TEST_UNUSED_BYTES), args->is_client); - if (fixture->client_result != nullptr && fixture->server_result == nullptr) { + if (fixture->client_result != nullptr && + fixture->server_result == nullptr) { fixture->has_client_finished_first = true; } } @@ -399,7 +401,8 @@ void tsi_test_do_handshake(tsi_test_fixture* fixture) { break; } GPR_ASSERT(client_args->transferred_data || server_args->transferred_data); - } while (fixture->client_result == nullptr || fixture->server_result == nullptr); + } while (fixture->client_result == nullptr || + fixture->server_result == nullptr); /* Verify handshake results. */ check_handshake_results(fixture); /* Cleanup. */ |