|
|
@@ -151,9 +151,11 @@ static grpc_byte_buffer* generate_handshaker_response(
|
|
|
result = grpc_gcp_HandshakerResp_mutable_result(resp, arena.ptr());
|
|
|
peer_identity =
|
|
|
grpc_gcp_HandshakerResult_mutable_peer_identity(result, arena.ptr());
|
|
|
- grpc_gcp_Identity_attributes_set(peer_identity, upb_strview_makez(
|
|
|
- ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY), upb_strview_makez(
|
|
|
- ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE), arena.ptr());
|
|
|
+ grpc_gcp_Identity_attributes_set(
|
|
|
+ peer_identity,
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY),
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE),
|
|
|
+ arena.ptr());
|
|
|
grpc_gcp_Identity_set_service_account(
|
|
|
peer_identity,
|
|
|
upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY));
|
|
|
@@ -183,9 +185,11 @@ static grpc_byte_buffer* generate_handshaker_response(
|
|
|
result = grpc_gcp_HandshakerResp_mutable_result(resp, arena.ptr());
|
|
|
peer_identity =
|
|
|
grpc_gcp_HandshakerResult_mutable_peer_identity(result, arena.ptr());
|
|
|
- grpc_gcp_Identity_attributes_set(peer_identity, upb_strview_makez(
|
|
|
- ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY), upb_strview_makez(
|
|
|
- ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE), arena.ptr());
|
|
|
+ grpc_gcp_Identity_attributes_set(
|
|
|
+ peer_identity,
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY),
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE),
|
|
|
+ arena.ptr());
|
|
|
grpc_gcp_Identity_set_service_account(
|
|
|
peer_identity,
|
|
|
upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_IDENTITY));
|
|
|
@@ -338,14 +342,23 @@ static void on_client_next_success_cb(tsi_result status, void* user_data,
|
|
|
GPR_ASSERT(memcmp(ALTS_TSI_HANDSHAKER_TEST_LOCAL_IDENTITY, local_account.data,
|
|
|
local_account.size) == 0);
|
|
|
size_t iter = UPB_MAP_BEGIN;
|
|
|
- grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
+ grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry =
|
|
|
+ grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
GPR_ASSERT(peer_attributes_entry != nullptr);
|
|
|
while ( peer_attributes_entry != nullptr) {
|
|
|
- upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(peer_attributes_entry));
|
|
|
- upb_strview val = grpc_gcp_AltsContext_PeerAttributesEntry_value(const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(peer_attributes_entry));
|
|
|
- GPR_ASSERT(upb_strview_eql(key, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY)));
|
|
|
- GPR_ASSERT(upb_strview_eql(val, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE)));
|
|
|
- peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
+ upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(
|
|
|
+ const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
|
|
|
+ peer_attributes_entry));
|
|
|
+ upb_strview val = grpc_gcp_AltsContext_PeerAttributesEntry_value(
|
|
|
+ const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
|
|
|
+ peer_attributes_entry));
|
|
|
+ GPR_ASSERT(upb_strview_eql(
|
|
|
+ key, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY)));
|
|
|
+ GPR_ASSERT(upb_strview_eql(
|
|
|
+ val,
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE)));
|
|
|
+ peer_attributes_entry =
|
|
|
+ grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
}
|
|
|
/* Validate security level. */
|
|
|
GPR_ASSERT(memcmp(ALTS_TSI_HANDSHAKER_TEST_SECURITY_LEVEL,
|
|
|
@@ -423,14 +436,23 @@ static void on_server_next_success_cb(tsi_result status, void* user_data,
|
|
|
local_account.size) == 0);
|
|
|
|
|
|
size_t iter = UPB_MAP_BEGIN;
|
|
|
- grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
+ grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry =
|
|
|
+ grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
GPR_ASSERT(peer_attributes_entry != nullptr);
|
|
|
while ( peer_attributes_entry != nullptr) {
|
|
|
- upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(peer_attributes_entry));
|
|
|
- upb_strview val = grpc_gcp_AltsContext_PeerAttributesEntry_value(const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(peer_attributes_entry));
|
|
|
- GPR_ASSERT(upb_strview_eql(key, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY)));
|
|
|
- GPR_ASSERT(upb_strview_eql(val, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE)));
|
|
|
- peer_attributes_entry = grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
+ upb_strview key = grpc_gcp_AltsContext_PeerAttributesEntry_key(
|
|
|
+ const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
|
|
|
+ peer_attributes_entry));
|
|
|
+ upb_strview val = grpc_gcp_AltsContext_PeerAttributesEntry_value(
|
|
|
+ const_cast<grpc_gcp_AltsContext_PeerAttributesEntry*>(
|
|
|
+ peer_attributes_entry));
|
|
|
+ GPR_ASSERT(upb_strview_eql(
|
|
|
+ key, upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_KEY)));
|
|
|
+ GPR_ASSERT(upb_strview_eql(
|
|
|
+ val,
|
|
|
+ upb_strview_makez(ALTS_TSI_HANDSHAKER_TEST_PEER_ATTRIBUTES_VALUE)));
|
|
|
+ peer_attributes_entry =
|
|
|
+ grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);
|
|
|
}
|
|
|
/* Check security level. */
|
|
|
GPR_ASSERT(memcmp(ALTS_TSI_HANDSHAKER_TEST_SECURITY_LEVEL,
|