[grpc][Gpr_To_Absl_Logging] Migrating from gpr to absl logging GPR_ASSERT

pull/36408/head
tanvi-jagtap 11 months ago
parent 94325c40fa
commit 5e3da3f772
  1. 4
      CMakeLists.txt
  2. 4
      build_autogenerated.yaml
  3. 20
      test/core/security/BUILD
  4. 2
      test/core/security/alts_credentials_fuzzer.cc
  5. 12
      test/core/security/aws_request_signer_test.cc
  6. 2
      test/core/security/fetch_oauth2.cc
  7. 8
      test/core/security/grpc_tls_certificate_distributor_test.cc
  8. 8
      test/core/security/grpc_tls_certificate_provider_test.cc
  9. 4
      test/core/security/print_google_default_creds_token.cc
  10. 3
      test/core/security/ssl_server_fuzzer.cc
  11. 146
      test/core/security/tls_security_connector_test.cc
  12. 2
      test/core/security/verify_jwt.cc

4
CMakeLists.txt generated

@ -7395,6 +7395,7 @@ target_include_directories(aws_request_signer_test
target_link_libraries(aws_request_signer_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc_test_util
)
@ -15799,6 +15800,7 @@ target_include_directories(grpc_tls_certificate_distributor_test
target_link_libraries(grpc_tls_certificate_distributor_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc_test_util
)
@ -15850,6 +15852,7 @@ target_include_directories(grpc_tls_certificate_provider_test
target_link_libraries(grpc_tls_certificate_provider_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc_test_util
)
@ -31267,6 +31270,7 @@ target_include_directories(tls_security_connector_test
target_link_libraries(tls_security_connector_test
${_gRPC_ALLTARGETS_LIBRARIES}
gtest
absl::check
grpc_test_util
)

@ -5775,6 +5775,7 @@ targets:
- test/core/util/tracer_util.cc
deps:
- gtest
- absl/log:check
- grpc_test_util
- name: backend_metrics_lb_policy_test
gtest: true
@ -10691,6 +10692,7 @@ targets:
- test/core/util/tracer_util.cc
deps:
- gtest
- absl/log:check
- grpc_test_util
- name: grpc_tls_certificate_provider_test
gtest: true
@ -10721,6 +10723,7 @@ targets:
- test/core/util/tracer_util.cc
deps:
- gtest
- absl/log:check
- grpc_test_util
- name: grpc_tls_certificate_verifier_test
gtest: true
@ -19545,6 +19548,7 @@ targets:
- test/core/util/tracer_util.cc
deps:
- gtest
- absl/log:check
- grpc_test_util
- name: too_many_pings_test
gtest: true

@ -23,6 +23,7 @@ grpc_fuzzer(
name = "alts_credentials_fuzzer",
srcs = ["alts_credentials_fuzzer.cc"],
corpus = "corpus/alts_credentials_corpus",
external_deps = ["absl/log:check"],
language = "C++",
tags = ["no_windows"],
deps = [
@ -42,6 +43,7 @@ grpc_fuzzer(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["absl/log:check"],
language = "C++",
tags = ["no_windows"],
deps = [
@ -109,7 +111,10 @@ grpc_cc_test(
grpc_cc_test(
name = "aws_request_signer_test",
srcs = ["aws_request_signer_test.cc"],
external_deps = ["gtest"],
external_deps = [
"absl/log:check",
"gtest",
],
language = "C++",
deps = [
"//:gpr",
@ -247,6 +252,7 @@ grpc_cc_binary(
grpc_cc_binary(
name = "fetch_oauth2",
srcs = ["fetch_oauth2.cc"],
external_deps = ["absl/log:check"],
language = "C++",
deps = [
":oauth2_utils",
@ -261,6 +267,7 @@ grpc_cc_binary(
grpc_cc_binary(
name = "verify_jwt",
srcs = ["verify_jwt.cc"],
external_deps = ["absl/log:check"],
language = "C++",
deps = [
"//:gpr",
@ -336,6 +343,7 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = [
"absl/log:check",
"gtest",
],
language = "C++",
@ -386,7 +394,10 @@ grpc_cc_test(
grpc_cc_test(
name = "grpc_tls_certificate_distributor_test",
srcs = ["grpc_tls_certificate_distributor_test.cc"],
external_deps = ["gtest"],
external_deps = [
"absl/log:check",
"gtest",
],
language = "C++",
deps = [
"//:gpr",
@ -409,7 +420,10 @@ grpc_cc_test(
"//src/core/tsi/test_creds:server1.key",
"//src/core/tsi/test_creds:server1.pem",
],
external_deps = ["gtest"],
external_deps = [
"absl/log:check",
"gtest",
],
language = "C++",
deps = [
"//:gpr",

@ -18,6 +18,8 @@
#include <string.h>
#include "absl/log/check.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>

@ -18,6 +18,8 @@
#include <gmock/gmock.h>
#include "absl/log/check.h"
#include <grpc/grpc_security.h>
#include "test/core/util/test_config.h"
@ -247,9 +249,8 @@ TEST(GrpcAwsRequestSignerTest, InvalidUrl) {
"token", "POST", "invalid_url",
"us-east-1", "", {}, &error);
std::string actual_error_description;
CHECK(grpc_error_get_str(error,
grpc_core::StatusStrProperty::kDescription,
&actual_error_description));
CHECK(grpc_error_get_str(error, grpc_core::StatusStrProperty::kDescription,
&actual_error_description));
EXPECT_EQ(actual_error_description, "Invalid Aws request url.");
}
@ -260,9 +261,8 @@ TEST(GrpcAwsRequestSignerTest, DuplicateRequestDate) {
"us-east-1", "", {{"date", kBotoTestDate}, {"x-amz-date", kAmzTestDate}},
&error);
std::string actual_error_description;
CHECK(grpc_error_get_str(error,
grpc_core::StatusStrProperty::kDescription,
&actual_error_description));
CHECK(grpc_error_get_str(error, grpc_core::StatusStrProperty::kDescription,
&actual_error_description));
EXPECT_EQ(actual_error_description,
"Only one of {date, x-amz-date} can be specified, not both.");
}

@ -19,6 +19,8 @@
#include <stdio.h>
#include <string.h>
#include "absl/log/check.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>

@ -24,6 +24,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/log/check.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@ -133,7 +135,7 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test {
void OnError(grpc_error_handle root_cert_error,
grpc_error_handle identity_cert_error) override {
CHECK_DONT(!root_cert_error.ok() || !identity_cert_error.ok());
CHECK(!root_cert_error.ok() || !identity_cert_error.ok());
std::string root_error_str;
std::string identity_error_str;
if (!root_cert_error.ok()) {
@ -142,8 +144,8 @@ class GrpcTlsCertificateDistributorTest : public ::testing::Test {
}
if (!identity_cert_error.ok()) {
CHECK(grpc_error_get_str(identity_cert_error,
StatusStrProperty::kDescription,
&identity_error_str));
StatusStrProperty::kDescription,
&identity_error_str));
}
state_->error_queue.emplace_back(std::move(root_error_str),
std::move(identity_error_str));

@ -22,6 +22,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/log/check.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@ -134,7 +136,7 @@ class GrpcTlsCertificateProviderTest : public ::testing::Test {
void OnError(grpc_error_handle root_cert_error,
grpc_error_handle identity_cert_error) override {
MutexLock lock(&state_->mu);
CHECK_DONT(!root_cert_error.ok() || !identity_cert_error.ok());
CHECK(!root_cert_error.ok() || !identity_cert_error.ok());
std::string root_error_str;
std::string identity_error_str;
if (!root_cert_error.ok()) {
@ -143,8 +145,8 @@ class GrpcTlsCertificateProviderTest : public ::testing::Test {
}
if (!identity_cert_error.ok()) {
CHECK(grpc_error_get_str(identity_cert_error,
StatusStrProperty::kDescription,
&identity_error_str));
StatusStrProperty::kDescription,
&identity_error_str));
}
state_->error_queue.emplace_back(std::move(root_error_str),
std::move(identity_error_str));

@ -19,6 +19,8 @@
#include <stdio.h>
#include <string.h>
#include "absl/log/check.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>
@ -50,7 +52,7 @@ static void on_metadata_response(void* arg, grpc_error_handle error) {
fflush(stderr);
} else {
char* token;
CHECK_EQ(sync->md_array.size, 1);
CHECK_EQ(sync->md_array.size, 1u);
token = grpc_slice_to_c_string(GRPC_MDVALUE(sync->md_array.md[0]));
printf("\nGot token: %s\n\n", token);
gpr_free(token);

@ -15,6 +15,7 @@
// limitations under the License.
//
//
#include "absl/log/check.h"
#include <grpc/event_engine/event_engine.h>
#include <grpc/grpc.h>
@ -56,7 +57,7 @@ static void on_handshake_done(void* arg, grpc_error_handle error) {
CHECK(state->done_callback_called == false);
state->done_callback_called = true;
// The fuzzer should not pass the handshake.
CHECK_DONT(!error.ok());
CHECK(!error.ok());
}
extern "C" int LLVMFuzzerTestOneInput(const uint8_t* data, size_t size) {

@ -24,6 +24,8 @@
#include <gmock/gmock.h>
#include <gtest/gtest.h>
#include "absl/log/check.h"
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
@ -368,12 +370,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
ExecCtx exec_ctx;
grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
@ -404,12 +406,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
const char* expected_error_msg =
"Custom verification check failed with error: UNAUTHENTICATED: "
@ -557,12 +559,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
ExecCtx exec_ctx;
grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
@ -593,12 +595,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
const char* expected_error_msg =
"Custom verification check failed with error: UNAUTHENTICATED: "
@ -631,28 +633,28 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a full TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(7, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
TSI_OK);
TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_SECURITY_LEVEL_PEER_PROPERTY,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
&peer.properties[3]) == TSI_OK);
TSI_SECURITY_LEVEL_PEER_PROPERTY,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
&peer.properties[3]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
&peer.properties[4]) == TSI_OK);
TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
&peer.properties[4]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[5]) == TSI_OK);
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[5]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
&peer.properties[6]) == TSI_OK);
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
&peer.properties[6]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
ExecCtx exec_ctx;
grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
@ -679,28 +681,28 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a full TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(7, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.com",
&peer.properties[1]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
TSI_OK);
TSI_X509_PEM_CERT_PROPERTY, "pem_cert", &peer.properties[2]) ==
TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_SECURITY_LEVEL_PEER_PROPERTY,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
&peer.properties[3]) == TSI_OK);
TSI_SECURITY_LEVEL_PEER_PROPERTY,
tsi_security_level_to_string(TSI_PRIVACY_AND_INTEGRITY),
&peer.properties[3]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
&peer.properties[4]) == TSI_OK);
TSI_X509_PEM_CERT_CHAIN_PROPERTY, "pem_cert_chain",
&peer.properties[4]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "*.com",
&peer.properties[5]) == TSI_OK);
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "*.com",
&peer.properties[5]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
&peer.properties[6]) == TSI_OK);
TSI_X509_SUBJECT_ALTERNATIVE_NAME_PEER_PROPERTY, "foo.baz.com",
&peer.properties[6]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
const char* expected_error_msg =
"Custom verification check failed with error: UNAUTHENTICATED: Hostname "
@ -988,12 +990,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
ExecCtx exec_ctx;
grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
@ -1019,12 +1021,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
const char* expected_error_msg =
"Custom verification check failed with error: UNAUTHENTICATED: "
@ -1054,12 +1056,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
ExecCtx exec_ctx;
grpc_closure* on_peer_checked = GRPC_CLOSURE_CREATE(
@ -1087,12 +1089,12 @@ TEST_F(TlsSecurityConnectorTest,
// Construct a basic TSI Peer.
tsi_peer peer;
CHECK(tsi_construct_peer(2, &peer) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL,
"h2", strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property(TSI_SSL_ALPN_SELECTED_PROTOCOL, "h2",
strlen("h2"),
&peer.properties[0]) == TSI_OK);
CHECK(tsi_construct_string_peer_property_from_cstring(
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
TSI_X509_SUBJECT_COMMON_NAME_PEER_PROPERTY, "foo.bar.com",
&peer.properties[1]) == TSI_OK);
RefCountedPtr<grpc_auth_context> auth_context;
const char* expected_error_msg =
"Custom verification check failed with error: UNAUTHENTICATED: "

@ -19,6 +19,8 @@
#include <stdio.h>
#include <string.h>
#include "absl/log/check.h"
#include <grpc/grpc.h>
#include <grpc/grpc_security.h>
#include <grpc/slice.h>

Loading…
Cancel
Save