|
|
@ -288,10 +288,7 @@ TEST_F(CredentialsTest, TlsKeyMaterialsConfigCppToC) { |
|
|
|
c_config->pem_key_cert_pair_list()[0].private_key()); |
|
|
|
c_config->pem_key_cert_pair_list()[0].private_key()); |
|
|
|
EXPECT_STREQ(pair.cert_chain.c_str(), |
|
|
|
EXPECT_STREQ(pair.cert_chain.c_str(), |
|
|
|
c_config->pem_key_cert_pair_list()[0].cert_chain()); |
|
|
|
c_config->pem_key_cert_pair_list()[0].cert_chain()); |
|
|
|
gpr_free(c_config->pem_key_cert_pair_list()[0].private_key()); |
|
|
|
delete c_config; |
|
|
|
gpr_free(c_config->pem_key_cert_pair_list()[0].cert_chain()); |
|
|
|
|
|
|
|
gpr_free(const_cast<char*>(c_config->pem_root_certs())); |
|
|
|
|
|
|
|
gpr_free(c_config); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST_F(CredentialsTest, TlsKeyMaterialsModifiers) { |
|
|
|
TEST_F(CredentialsTest, TlsKeyMaterialsModifiers) { |
|
|
@ -371,8 +368,8 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigSchedule) { |
|
|
|
if (c_arg->destroy_context != nullptr) { |
|
|
|
if (c_arg->destroy_context != nullptr) { |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
} |
|
|
|
} |
|
|
|
gpr_free(c_arg); |
|
|
|
delete c_arg; |
|
|
|
gpr_free(config->c_config()); |
|
|
|
delete config->c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { |
|
|
|
TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { |
|
|
@ -423,7 +420,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigCppToC) { |
|
|
|
|
|
|
|
|
|
|
|
// Cleanup.
|
|
|
|
// Cleanup.
|
|
|
|
c_arg.destroy_context(c_arg.context); |
|
|
|
c_arg.destroy_context(c_arg.context); |
|
|
|
::delete config.c_config(); |
|
|
|
delete config.c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg |
|
|
|
typedef class ::grpc_impl::experimental::TlsServerAuthorizationCheckArg |
|
|
@ -507,8 +504,8 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigSchedule) { |
|
|
|
if (c_arg->destroy_context != nullptr) { |
|
|
|
if (c_arg->destroy_context != nullptr) { |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
} |
|
|
|
} |
|
|
|
gpr_free(c_arg); |
|
|
|
delete c_arg; |
|
|
|
gpr_free(config.c_config()); |
|
|
|
delete config.c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { |
|
|
|
TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { |
|
|
@ -540,7 +537,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigCppToC) { |
|
|
|
gpr_free(const_cast<char*>(c_arg.error_details)); |
|
|
|
gpr_free(const_cast<char*>(c_arg.error_details)); |
|
|
|
gpr_free(const_cast<char*>(c_arg.target_name)); |
|
|
|
gpr_free(const_cast<char*>(c_arg.target_name)); |
|
|
|
gpr_free(const_cast<char*>(c_arg.peer_cert)); |
|
|
|
gpr_free(const_cast<char*>(c_arg.peer_cert)); |
|
|
|
gpr_free(config.c_config()); |
|
|
|
delete config.c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
typedef class ::grpc_impl::experimental::TlsCredentialsOptions |
|
|
|
typedef class ::grpc_impl::experimental::TlsCredentialsOptions |
|
|
@ -640,7 +637,6 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { |
|
|
|
"sync_error_details"); |
|
|
|
"sync_error_details"); |
|
|
|
|
|
|
|
|
|
|
|
// Cleanup.
|
|
|
|
// Cleanup.
|
|
|
|
::delete c_credential_reload_arg.key_materials_config; |
|
|
|
|
|
|
|
c_credential_reload_arg.destroy_context(c_credential_reload_arg.context); |
|
|
|
c_credential_reload_arg.destroy_context(c_credential_reload_arg.context); |
|
|
|
c_server_authorization_check_arg.destroy_context( |
|
|
|
c_server_authorization_check_arg.destroy_context( |
|
|
|
c_server_authorization_check_arg.context); |
|
|
|
c_server_authorization_check_arg.context); |
|
|
@ -648,9 +644,7 @@ TEST_F(CredentialsTest, TlsCredentialsOptionsCppToC) { |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.target_name)); |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.target_name)); |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.peer_cert)); |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.peer_cert)); |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.error_details)); |
|
|
|
gpr_free(const_cast<char*>(c_server_authorization_check_arg.error_details)); |
|
|
|
::delete c_credential_reload_config; |
|
|
|
delete c_options; |
|
|
|
::delete c_server_authorization_check_config; |
|
|
|
|
|
|
|
gpr_free(c_options); |
|
|
|
|
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
// This test demonstrates how the SPIFFE credentials will be used.
|
|
|
|
// This test demonstrates how the SPIFFE credentials will be used.
|
|
|
@ -700,7 +694,7 @@ TEST_F(CredentialsTest, TlsCredentialReloadConfigErrorMessages) { |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
} |
|
|
|
} |
|
|
|
delete c_arg; |
|
|
|
delete c_arg; |
|
|
|
gpr_free(config->c_config()); |
|
|
|
delete config->c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { |
|
|
|
TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { |
|
|
@ -733,7 +727,7 @@ TEST_F(CredentialsTest, TlsServerAuthorizationCheckConfigErrorMessages) { |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
c_arg->destroy_context(c_arg->context); |
|
|
|
} |
|
|
|
} |
|
|
|
delete c_arg; |
|
|
|
delete c_arg; |
|
|
|
gpr_free(config->c_config()); |
|
|
|
delete config->c_config(); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
} // namespace testing
|
|
|
|
} // namespace testing
|
|
|
|