diff --git a/src/core/lib/security/security_connector/local_security_connector.cc b/src/core/lib/security/security_connector/local_security_connector.cc index 29e60e56f6b..bd6a6a083d3 100644 --- a/src/core/lib/security/security_connector/local_security_connector.cc +++ b/src/core/lib/security/security_connector/local_security_connector.cc @@ -34,6 +34,7 @@ #include "src/core/lib/security/transport/security_handshaker.h" #include "src/core/tsi/local_transport_security.h" +#define GRPC_UDS_URL_PATTERN "unix:" #define GRPC_UDS_URL_SCHEME "unix" #define GRPC_LOCAL_TRANSPORT_SECURITY_TYPE "local" @@ -189,8 +190,8 @@ grpc_security_status grpc_local_channel_security_connector_create( const grpc_arg* server_uri_arg = grpc_channel_args_find(args, GRPC_ARG_SERVER_URI); const char* server_uri_str = grpc_channel_arg_get_string(server_uri_arg); - if (strncmp(GRPC_UDS_URL_SCHEME, server_uri_str, - strlen(GRPC_UDS_URL_SCHEME)) != 0) { + if (strncmp(GRPC_UDS_URL_PATTERN, server_uri_str, + strlen(GRPC_UDS_URL_PATTERN)) != 0) { gpr_log(GPR_ERROR, "Invalid target_name to " "grpc_local_channel_security_connector_create()"); diff --git a/test/core/end2end/fixtures/h2_local.cc b/test/core/end2end/fixtures/h2_local.cc index 9588a4ed0f0..cce8f1745a8 100644 --- a/test/core/end2end/fixtures/h2_local.cc +++ b/test/core/end2end/fixtures/h2_local.cc @@ -73,16 +73,21 @@ void chttp2_init_client_fullstack(grpc_end2end_test_fixture* f, grpc_channel_credentials_release(creds); } -static int fail_server_auth_check(grpc_channel_args* server_args) { +/* + * Check if server should fail auth check. If it is true, a different metadata + * processor will be installed that always fails in processing client's + * metadata. + */ +static bool fail_server_auth_check(grpc_channel_args* server_args) { size_t i; if (server_args == nullptr) return 0; for (i = 0; i < server_args->num_args; i++) { if (strcmp(server_args->args[i].key, FAIL_AUTH_CHECK_SERVER_ARG_NAME) == 0) { - return 1; + return true; } } - return 0; + return false; } static void process_auth_failure(void* state, grpc_auth_context* ctx,