alts_handshaker_client_test.cc
Go to the documentation of this file.
1 /*
2  *
3  * Copyright 2018 gRPC authors.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License");
6  * you may not use this file except in compliance with the License.
7  * You may obtain a copy of the License at
8  *
9  * http://www.apache.org/licenses/LICENSE-2.0
10  *
11  * Unless required by applicable law or agreed to in writing, software
12  * distributed under the License is distributed on an "AS IS" BASIS,
13  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14  * See the License for the specific language governing permissions and
15  * limitations under the License.
16  *
17  */
18 
20 
21 #include "upb/upb.hpp"
22 
23 #include <grpc/grpc.h>
24 #include <grpc/grpc_security.h>
25 
33 
34 #define ALTS_HANDSHAKER_CLIENT_TEST_OUT_FRAME "Hello Google"
35 #define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME "bigtable.google.api.com"
36 #define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1 "A@google.com"
37 #define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2 "B@google.com"
38 #define ALTS_HANDSHAKER_CLIENT_TEST_MAX_FRAME_SIZE (64 * 1024)
39 
40 const size_t kHandshakerClientOpNum = 4;
41 const size_t kMaxRpcVersionMajor = 3;
42 const size_t kMaxRpcVersionMinor = 2;
43 const size_t kMinRpcVersionMajor = 2;
44 const size_t kMinRpcVersionMinor = 1;
45 
56 
64 
66  const grpc_gcp_RpcProtocolVersions* versions) {
67  GPR_ASSERT(versions != nullptr);
68  const grpc_gcp_RpcProtocolVersions_Version* max_version =
70  const grpc_gcp_RpcProtocolVersions_Version* min_version =
80 }
81 
83  const grpc_gcp_Identity* const* target_identities,
84  size_t target_identities_count) {
85  GPR_ASSERT(target_identities_count == 2);
86  const grpc_gcp_Identity* identity1 = target_identities[1];
87  const grpc_gcp_Identity* identity2 = target_identities[0];
96 }
97 
103  size_t nops, bool is_start) {
104  GPR_ASSERT(c != nullptr && op != nullptr && nops != 0);
105  bool ok = true;
106  grpc_op* start_op = const_cast<grpc_op*>(op);
107  if (is_start) {
109  ok &= (op->data.send_initial_metadata.count == 0);
110  op++;
111  GPR_ASSERT((size_t)(op - start_op) <= kHandshakerClientOpNum);
115  op++;
116  GPR_ASSERT((size_t)(op - start_op) <= kHandshakerClientOpNum);
117  }
118  ok &= (op->op == GRPC_OP_SEND_MESSAGE);
121  op++;
122  GPR_ASSERT((size_t)(op - start_op) <= kHandshakerClientOpNum);
123  ok &= (op->op == GRPC_OP_RECV_MESSAGE);
126  op++;
127  GPR_ASSERT((size_t)(op - start_op) <= kHandshakerClientOpNum);
128  return ok;
129 }
130 
133  GPR_ASSERT(buffer != nullptr);
138  GPR_ASSERT(req != nullptr);
141  return req;
142 }
143 
144 static bool is_recv_status_op(const grpc_op* op, size_t nops) {
145  return nops == 1 && op->op == GRPC_OP_RECV_STATUS_ON_CLIENT;
146 }
147 
153  const grpc_op* /*ops*/,
154  size_t /*nops*/,
155  grpc_closure* /*tag*/) {
156  GPR_ASSERT(0);
157 }
158 
166  const grpc_op* op,
167  size_t nops,
169  // RECV_STATUS ops are asserted to always succeed
170  if (is_recv_status_op(op, nops)) {
171  return GRPC_CALL_OK;
172  }
175  static_cast<alts_handshaker_client*>(closure->cb_arg);
179  const grpc_gcp_StartClientHandshakeReq* client_start =
182  client_start) == grpc_gcp_ALTS);
183  upb_StringView const* application_protocols =
185  nullptr);
187  application_protocols[0],
189  upb_StringView const* record_protocols =
192  record_protocols[0], upb_StringView_FromString(ALTS_RECORD_PROTOCOL)));
193  const grpc_gcp_RpcProtocolVersions* rpc_protocol_versions =
195  validate_rpc_protocol_versions(rpc_protocol_versions);
196  size_t target_identities_count;
197  const grpc_gcp_Identity* const* target_identities =
199  client_start, &target_identities_count);
200  validate_target_identities(target_identities, target_identities_count);
206  GPR_ASSERT(validate_op(client, op, nops, true /* is_start */));
207  return GRPC_CALL_OK;
208 }
209 
217  const grpc_op* op,
218  size_t nops,
220  // RECV_STATUS ops are asserted to always succeed
221  if (is_recv_status_op(op, nops)) {
222  return GRPC_CALL_OK;
223  }
226  static_cast<alts_handshaker_client*>(closure->cb_arg);
230  const grpc_gcp_StartServerHandshakeReq* server_start =
232  upb_StringView const* application_protocols =
234  nullptr);
236  application_protocols[0],
239  server_start) == 1);
242  server_start, grpc_gcp_ALTS, &value));
243  upb_StringView const* record_protocols =
246  record_protocols[0], upb_StringView_FromString(ALTS_RECORD_PROTOCOL)));
251  GPR_ASSERT(validate_op(client, op, nops, true /* is_start */));
252  return GRPC_CALL_OK;
253 }
254 
261  const grpc_op* op, size_t nops,
265  static_cast<alts_handshaker_client*>(closure->cb_arg);
274  GPR_ASSERT(validate_op(client, op, nops, false /* is_start */));
275  return GRPC_CALL_OK;
276 }
277 
284  const grpc_op* op, size_t nops,
285  grpc_closure* /*tag*/) {
286  // RECV_STATUS ops are asserted to always succeed
287  if (is_recv_status_op(op, nops)) {
288  return GRPC_CALL_OK;
289  }
290  return GRPC_CALL_ERROR;
291 }
292 
294  bool is_client) {
298  if (is_client) {
303  }
304  grpc_gcp_rpc_protocol_versions* versions = &options->rpc_versions;
309  return options;
310 }
311 
315  gpr_zalloc(sizeof(*config)));
318  creds, nullptr);
321  grpc_alts_credentials_options* client_options =
322  create_credentials_options(true /* is_client */);
324  create_credentials_options(false /* is_client */);
327  nullptr, server_options,
329  nullptr, nullptr, nullptr, nullptr, false,
333  nullptr, client_options,
335  nullptr, nullptr, nullptr, nullptr, true,
337  GPR_ASSERT(config->client != nullptr);
338  GPR_ASSERT(config->server != nullptr);
341  config->out_frame =
343  return config;
344 }
345 
347  if (config == nullptr) {
348  return;
349  }
351  grpc_channel_destroy(config->channel);
354  grpc_slice_unref(config->out_frame);
355  gpr_free(config);
356 }
357 
359  /* Initialization. */
361  /* Tests. */
364  /* Check client_start. */
365  {
369  }
370  /* Check server_start. */
371  {
375  }
376  {
379  nullptr, &config->out_frame) == TSI_INVALID_ARGUMENT);
380  }
381  /* Check next. */
382  {
384  GPR_ASSERT(alts_handshaker_client_next(config->client, nullptr) ==
386  }
387  {
389  GPR_ASSERT(alts_handshaker_client_next(nullptr, &config->out_frame) ==
391  }
392  /* Check shutdown. */
394  /* Cleanup. */
396 }
397 
399  /* Initialization. */
401  /* Check client_start success. */
404  {
407  }
408  {
410  GPR_ASSERT(alts_handshaker_client_next(nullptr, &config->out_frame) ==
412  }
413  /* Check server_start success. */
416  {
419  config->server, &config->out_frame) == TSI_OK);
420  }
421  /* Check client next success. */
424  {
427  &config->out_frame) == TSI_OK);
428  }
429  /* Check server next success. */
432  {
435  &config->out_frame) == TSI_OK);
436  }
437  /* Cleanup. */
438  {
444  }
446 }
447 
449  tsi_result status, void* /*user_data*/,
450  const unsigned char* /*bytes_to_send*/, size_t /*bytes_to_send_size*/,
451  tsi_handshaker_result* /*result*/) {
453 }
454 
456  /* Initialization. */
458  /* Check client_start failure. */
461  {
463  // TODO(apolcyn): go back to asserting TSI_INTERNAL_ERROR as return
464  // value instead of callback status, after removing the global
465  // queue in https://github.com/grpc/grpc/pull/20722
469  }
470  /* Check server_start failure. */
473  {
475  // TODO(apolcyn): go back to asserting TSI_INTERNAL_ERROR as return
476  // value instead of callback status, after removing the global
477  // queue in https://github.com/grpc/grpc/pull/20722
480  alts_handshaker_client_start_server(config->server, &config->out_frame);
481  }
482  {
484  /* Check client next failure. */
486  config->client, &config->out_frame) == TSI_INTERNAL_ERROR);
487  }
488  {
490  /* Check server next failure. */
492  config->server, &config->out_frame) == TSI_INTERNAL_ERROR);
493  }
494  /* Cleanup. */
495  {
501  }
503 }
504 
505 int main(int argc, char** argv) {
506  grpc::testing::TestEnvironment env(&argc, argv);
507  /* Initialization. */
508  grpc_init();
510  /* Tests. */
514  /* Cleanup. */
516  grpc_shutdown();
517  return 0;
518 }
alts_handshaker_client_start_server
tsi_result alts_handshaker_client_start_server(alts_handshaker_client *client, grpc_slice *bytes_received)
Definition: alts_handshaker_client.cc:873
grpc_gcp_NextHandshakeMessageReq
struct grpc_gcp_NextHandshakeMessageReq grpc_gcp_NextHandshakeMessageReq
Definition: handshaker.upb.h:42
grpc_slice_unref
GPRAPI void grpc_slice_unref(grpc_slice s)
Definition: slice_api.cc:32
grpc_alts_credentials_options_destroy
GRPCAPI void grpc_alts_credentials_options_destroy(grpc_alts_credentials_options *options)
Definition: grpc_alts_credentials_options.cc:38
grpc_core::internal::alts_handshaker_client_set_cb_for_testing
void alts_handshaker_client_set_cb_for_testing(alts_handshaker_client *c, tsi_handshaker_on_next_done_cb cb)
Definition: alts_handshaker_client.cc:822
grpc_op::grpc_op_data::grpc_op_send_message::send_message
struct grpc_byte_buffer * send_message
Definition: grpc_types.h:668
grpc_call_error
grpc_call_error
Definition: grpc_types.h:464
grpc_gcp_Identity_service_account
UPB_INLINE upb_StringView grpc_gcp_Identity_service_account(const grpc_gcp_Identity *msg)
Definition: handshaker.upb.h:181
grpc_gcp_RpcProtocolVersions_Version
struct grpc_gcp_RpcProtocolVersions_Version grpc_gcp_RpcProtocolVersions_Version
Definition: transport_security_common.upb.h:26
GRPC_ERROR_NONE
#define GRPC_ERROR_NONE
Definition: error.h:234
deserialize_handshaker_req
static grpc_gcp_HandshakerReq * deserialize_handshaker_req(grpc_byte_buffer *buffer, upb_Arena *arena)
Definition: alts_handshaker_client_test.cc:131
grpc_gcp_StartServerHandshakeReq_handshake_parameters_get
UPB_INLINE bool grpc_gcp_StartServerHandshakeReq_handshake_parameters_get(const grpc_gcp_StartServerHandshakeReq *msg, int32_t key, grpc_gcp_ServerHandshakeParameters **val)
Definition: handshaker.upb.h:557
alts_tsi_handshaker_private.h
generate.env
env
Definition: generate.py:37
alts_handshaker_client_test_config
struct alts_handshaker_client_test_config alts_handshaker_client_test_config
GRPC_CALL_ERROR
@ GRPC_CALL_ERROR
Definition: grpc_types.h:468
grpc_gcp_StartClientHandshakeReq_target_identities
const UPB_INLINE grpc_gcp_Identity *const * grpc_gcp_StartClientHandshakeReq_target_identities(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len)
Definition: handshaker.upb.h:298
grpc_op::grpc_op_data::send_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_send_initial_metadata send_initial_metadata
grpc_gcp_HandshakerReq_server_start
const UPB_INLINE grpc_gcp_StartServerHandshakeReq * grpc_gcp_HandshakerReq_server_start(const grpc_gcp_HandshakerReq *msg)
Definition: handshaker.upb.h:785
check_must_not_be_called
static grpc_call_error check_must_not_be_called(grpc_call *, const grpc_op *, size_t, grpc_closure *)
Definition: alts_handshaker_client_test.cc:152
TSI_INTERNAL_ERROR
@ TSI_INTERNAL_ERROR
Definition: transport_security_interface.h:39
grpc_core::internal::alts_handshaker_client_get_recv_buffer_addr_for_testing
grpc_byte_buffer ** alts_handshaker_client_get_recv_buffer_addr_for_testing(alts_handshaker_client *c)
Definition: alts_handshaker_client.cc:752
client
Definition: examples/python/async_streaming/client.py:1
alts_tsi_handshaker.h
grpc_gcp_StartClientHandshakeReq_handshake_security_protocol
UPB_INLINE int32_t grpc_gcp_StartClientHandshakeReq_handshake_security_protocol(const grpc_gcp_StartClientHandshakeReq *msg)
Definition: handshaker.upb.h:277
grpc_gcp_StartServerHandshakeReq_handshake_parameters_size
UPB_INLINE size_t grpc_gcp_StartServerHandshakeReq_handshake_parameters_size(const grpc_gcp_StartServerHandshakeReq *msg)
Definition: handshaker.upb.h:554
grpc_byte_buffer_reader_readall
GRPCAPI grpc_slice grpc_byte_buffer_reader_readall(grpc_byte_buffer_reader *reader)
Definition: byte_buffer_reader.cc:84
options
double_dict options[]
Definition: capstone_test.c:55
grpc_alts_shared_resource_dedicated_init
void grpc_alts_shared_resource_dedicated_init()
Definition: alts_shared_resource.cc:50
gpr_free
GPRAPI void gpr_free(void *ptr)
Definition: alloc.cc:51
grpc_gcp_handshaker_req_decode
grpc_gcp_HandshakerReq * grpc_gcp_handshaker_req_decode(grpc_slice slice, upb_Arena *arena)
Definition: alts_handshaker_service_api_test_lib.cc:44
check_next_success
static grpc_call_error check_next_success(grpc_call *, const grpc_op *op, size_t nops, grpc_closure *closure)
Definition: alts_handshaker_client_test.cc:260
alts_handshaker_client_test_config::server
alts_handshaker_client * server
Definition: alts_handshaker_client_test.cc:61
GRPC_CALL_OK
@ GRPC_CALL_OK
Definition: grpc_types.h:466
status
absl::Status status
Definition: rls.cc:251
ALTS_HANDSHAKER_CLIENT_TEST_MAX_FRAME_SIZE
#define ALTS_HANDSHAKER_CLIENT_TEST_MAX_FRAME_SIZE
Definition: alts_handshaker_client_test.cc:38
grpc_alts_shared_resource_dedicated_shutdown
void grpc_alts_shared_resource_dedicated_shutdown()
Definition: alts_shared_resource.cc:80
kMinRpcVersionMinor
const size_t kMinRpcVersionMinor
Definition: alts_handshaker_client_test.cc:44
grpc_security.h
alts_grpc_handshaker_client_create
alts_handshaker_client * alts_grpc_handshaker_client_create(alts_tsi_handshaker *handshaker, grpc_channel *channel, const char *handshaker_service_url, grpc_pollset_set *interested_parties, grpc_alts_credentials_options *options, const grpc_slice &target_name, grpc_iomgr_cb_func grpc_cb, tsi_handshaker_on_next_done_cb cb, void *user_data, alts_handshaker_client_vtable *vtable_for_testing, bool is_client, size_t max_frame_size)
Definition: alts_handshaker_client.cc:687
grpc_op::grpc_op_data::recv_message
struct grpc_op::grpc_op_data::grpc_op_recv_message recv_message
arena
grpc_core::ScopedArenaPtr arena
Definition: binder_transport_test.cc:237
grpc_op::data
union grpc_op::grpc_op_data data
destroy_config
static void destroy_config(alts_handshaker_client_test_config *config)
Definition: alts_handshaker_client_test.cc:346
kHandshakerClientOpNum
const size_t kHandshakerClientOpNum
Definition: alts_handshaker_client_test.cc:40
grpc_gcp_HandshakerReq
struct grpc_gcp_HandshakerReq grpc_gcp_HandshakerReq
Definition: handshaker.upb.h:43
gpr_zalloc
GPRAPI void * gpr_zalloc(size_t size)
Definition: alloc.cc:40
grpc_gcp_StartServerHandshakeReq_application_protocols
UPB_INLINE upb_StringView const * grpc_gcp_StartServerHandshakeReq_application_protocols(const grpc_gcp_StartServerHandshakeReq *msg, size_t *len)
Definition: handshaker.upb.h:545
grpc_gcp_ServerHandshakeParameters
struct grpc_gcp_ServerHandshakeParameters grpc_gcp_ServerHandshakeParameters
Definition: handshaker.upb.h:39
alts_handshaker_client_shutdown
void alts_handshaker_client_shutdown(alts_handshaker_client *client)
Definition: alts_handshaker_client.cc:895
ALTS_HANDSHAKER_SERVICE_URL_FOR_TESTING
#define ALTS_HANDSHAKER_SERVICE_URL_FOR_TESTING
Definition: alts_handshaker_client.h:36
TSI_OK
@ TSI_OK
Definition: transport_security_interface.h:32
grpc_op::grpc_op_data::grpc_op_recv_message::recv_message
struct grpc_byte_buffer ** recv_message
Definition: grpc_types.h:693
grpc_gcp_StartClientHandshakeReq_target_name
UPB_INLINE upb_StringView grpc_gcp_StartClientHandshakeReq_target_name(const grpc_gcp_StartClientHandshakeReq *msg)
Definition: handshaker.upb.h:331
grpc_gcp_RpcProtocolVersions_max_rpc_version
const UPB_INLINE grpc_gcp_RpcProtocolVersions_Version * grpc_gcp_RpcProtocolVersions_max_rpc_version(const grpc_gcp_RpcProtocolVersions *msg)
Definition: transport_security_common.upb.h:75
alts_handshaker_client_test_config::channel
grpc_channel * channel
Definition: alts_handshaker_client_test.cc:58
alts_handshaker_client.h
c
void c(T a)
Definition: miscompile_with_no_unique_address_test.cc:40
grpc_alts_credentials_client_options_create
GRPCAPI grpc_alts_credentials_options * grpc_alts_credentials_client_options_create(void)
Definition: grpc_alts_credentials_client_options.cc:73
GRPC_STATUS_OK
@ GRPC_STATUS_OK
Definition: include/grpc/impl/codegen/status.h:30
GRPC_OP_RECV_INITIAL_METADATA
@ GRPC_OP_RECV_INITIAL_METADATA
Definition: grpc_types.h:617
GPR_ASSERT
#define GPR_ASSERT(x)
Definition: include/grpc/impl/codegen/log.h:94
alts_handshaker_client_test_config
Definition: alts_handshaker_client_test.cc:57
config
struct config_s config
req
static uv_connect_t req
Definition: test-connection-fail.c:30
slice
grpc_slice slice
Definition: src/core/lib/surface/server.cc:467
grpc_gcp_RpcProtocolVersions_Version_major
UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_major(const grpc_gcp_RpcProtocolVersions_Version *msg)
Definition: transport_security_common.upb.h:149
alts_handshaker_client_start_client
tsi_result alts_handshaker_client_start_client(alts_handshaker_client *client)
Definition: alts_handshaker_client.cc:863
grpc_gcp_RpcProtocolVersions_Version_minor
UPB_INLINE uint32_t grpc_gcp_RpcProtocolVersions_Version_minor(const grpc_gcp_RpcProtocolVersions_Version *msg)
Definition: transport_security_common.upb.h:155
grpc_completion_queue
Definition: completion_queue.cc:347
grpc_alts_credentials_client_options_add_target_service_account
GRPCAPI void grpc_alts_credentials_client_options_add_target_service_account(grpc_alts_credentials_options *options, const char *service_account)
Definition: grpc_alts_credentials_client_options.cc:45
grpc_byte_buffer_reader_init
GRPCAPI int grpc_byte_buffer_reader_init(grpc_byte_buffer_reader *reader, grpc_byte_buffer *buffer)
Definition: byte_buffer_reader.cc:33
schedule_request_invalid_arg_test
static void schedule_request_invalid_arg_test()
Definition: alts_handshaker_client_test.cc:358
grpc.h
grpc_call
struct grpc_call grpc_call
Definition: grpc_types.h:70
grpc_core::internal::alts_handshaker_client_get_send_buffer_for_testing
grpc_byte_buffer * alts_handshaker_client_get_send_buffer_for_testing(alts_handshaker_client *c)
Definition: alts_handshaker_client.cc:744
grpc_byte_buffer
Definition: grpc_types.h:43
grpc_gcp_StartServerHandshakeReq
struct grpc_gcp_StartServerHandshakeReq grpc_gcp_StartServerHandshakeReq
Definition: handshaker.upb.h:40
tsi_result
tsi_result
Definition: transport_security_interface.h:31
grpc_insecure_credentials_create
GRPCAPI grpc_channel_credentials * grpc_insecure_credentials_create()
Definition: core/lib/security/credentials/insecure/insecure_credentials.cc:64
ALTS_HANDSHAKER_CLIENT_TEST_OUT_FRAME
#define ALTS_HANDSHAKER_CLIENT_TEST_OUT_FRAME
Definition: alts_handshaker_client_test.cc:34
grpc_op
Definition: grpc_types.h:640
GRPC_OP_SEND_MESSAGE
@ GRPC_OP_SEND_MESSAGE
Definition: grpc_types.h:602
alts_handshaker_client_test_config::client
alts_handshaker_client * client
Definition: alts_handshaker_client_test.cc:60
grpc_core::internal::alts_handshaker_client_get_closure_for_testing
grpc_closure * alts_handshaker_client_get_closure_for_testing(alts_handshaker_client *c)
Definition: alts_handshaker_client.cc:830
grpc_slice_from_static_string
GPRAPI grpc_slice grpc_slice_from_static_string(const char *source)
Definition: slice/slice.cc:89
grpc_slice
Definition: include/grpc/impl/codegen/slice.h:65
alts_handshaker_client
Definition: alts_handshaker_client.cc:43
ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME
#define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_NAME
Definition: alts_handshaker_client_test.cc:35
alts_shared_resource.h
grpc_gcp_StartServerHandshakeReq_max_frame_size
UPB_INLINE uint32_t grpc_gcp_StartServerHandshakeReq_max_frame_size(const grpc_gcp_StartServerHandshakeReq *msg)
Definition: handshaker.upb.h:599
alts_handshaker_client_next
tsi_result alts_handshaker_client_next(alts_handshaker_client *client, grpc_slice *bytes_received)
Definition: alts_handshaker_client.cc:884
validate_rpc_protocol_versions
static void validate_rpc_protocol_versions(const grpc_gcp_RpcProtocolVersions *versions)
Definition: alts_handshaker_client_test.cc:65
buffer
char buffer[1024]
Definition: libuv/docs/code/idle-compute/main.c:8
grpc_gcp_StartServerHandshakeReq_rpc_versions
UPB_INLINE const struct grpc_gcp_RpcProtocolVersions * grpc_gcp_StartServerHandshakeReq_rpc_versions(const grpc_gcp_StartServerHandshakeReq *msg)
Definition: handshaker.upb.h:593
upb_StringView_IsEqual
UPB_INLINE bool upb_StringView_IsEqual(upb_StringView a, upb_StringView b)
Definition: upb/upb/upb.h:89
grpc_gcp_RpcProtocolVersions
struct grpc_gcp_RpcProtocolVersions grpc_gcp_RpcProtocolVersions
Definition: transport_security_common.upb.h:25
grpc_gcp_rpc_protocol_versions_set_min
bool grpc_gcp_rpc_protocol_versions_set_min(grpc_gcp_rpc_protocol_versions *versions, uint32_t min_major, uint32_t min_minor)
Definition: transport_security_common_api.cc:39
grpc_core::ExecCtx
Definition: exec_ctx.h:97
transport_security_interface.h
main
int main(int argc, char **argv)
Definition: alts_handshaker_client_test.cc:505
grpc_gcp_StartClientHandshakeReq_application_protocols
UPB_INLINE upb_StringView const * grpc_gcp_StartClientHandshakeReq_application_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len)
Definition: handshaker.upb.h:283
grpc_op::op
grpc_op_type op
Definition: grpc_types.h:642
check_server_start_success
static grpc_call_error check_server_start_success(grpc_call *, const grpc_op *op, size_t nops, grpc_closure *closure)
Definition: alts_handshaker_client_test.cc:216
grpc_op::grpc_op_data::grpc_op_send_initial_metadata::count
size_t count
Definition: grpc_types.h:653
kMaxRpcVersionMinor
const size_t kMaxRpcVersionMinor
Definition: alts_handshaker_client_test.cc:42
test_config.h
value
const char * value
Definition: hpack_parser_table.cc:165
grpc_channel_credentials_release
GRPCAPI void grpc_channel_credentials_release(grpc_channel_credentials *creds)
Definition: credentials.cc:36
grpc.beta.implementations.server_options
def server_options(multi_method_implementation=None, request_deserializers=None, response_serializers=None, thread_pool=None, thread_pool_size=None, default_timeout=None, maximum_timeout=None)
Definition: implementations.py:258
grpc_gcp_HandshakerReq_client_start
const UPB_INLINE grpc_gcp_StartClientHandshakeReq * grpc_gcp_HandshakerReq_client_start(const grpc_gcp_HandshakerReq *msg)
Definition: handshaker.upb.h:776
GRPC_OP_RECV_MESSAGE
@ GRPC_OP_RECV_MESSAGE
Definition: grpc_types.h:621
grpc_alts_credentials_options
Definition: grpc_alts_credentials_options.h:35
validate_target_identities
static void validate_target_identities(const grpc_gcp_Identity *const *target_identities, size_t target_identities_count)
Definition: alts_handshaker_client_test.cc:82
upb::Arena
Definition: upb.hpp:68
transport_security.h
grpc_channel_create
GRPCAPI grpc_channel * grpc_channel_create(const char *target, grpc_channel_credentials *creds, const grpc_channel_args *args)
Definition: chttp2_connector.cc:366
grpc_gcp_Identity
struct grpc_gcp_Identity grpc_gcp_Identity
Definition: handshaker.upb.h:36
grpc_alts_credentials_server_options_create
GRPCAPI grpc_alts_credentials_options * grpc_alts_credentials_server_options_create(void)
Definition: grpc_alts_credentials_server_options.cc:36
ALTS_APPLICATION_PROTOCOL
#define ALTS_APPLICATION_PROTOCOL
Definition: alts_handshaker_client.h:34
grpc_gcp_StartClientHandshakeReq_record_protocols
UPB_INLINE upb_StringView const * grpc_gcp_StartClientHandshakeReq_record_protocols(const grpc_gcp_StartClientHandshakeReq *msg, size_t *len)
Definition: handshaker.upb.h:289
upb_StringView
Definition: upb/upb/upb.h:72
grpc_gcp_StartClientHandshakeReq_rpc_versions
UPB_INLINE const struct grpc_gcp_RpcProtocolVersions * grpc_gcp_StartClientHandshakeReq_rpc_versions(const grpc_gcp_StartClientHandshakeReq *msg)
Definition: handshaker.upb.h:340
create_config
static alts_handshaker_client_test_config * create_config()
Definition: alts_handshaker_client_test.cc:312
grpc_completion_queue_destroy
GRPCAPI void grpc_completion_queue_destroy(grpc_completion_queue *cq)
Definition: completion_queue.cc:1424
alts_handshaker_client_destroy
void alts_handshaker_client_destroy(alts_handshaker_client *c)
Definition: alts_handshaker_client.cc:902
upb.hpp
GRPC_OP_SEND_INITIAL_METADATA
@ GRPC_OP_SEND_INITIAL_METADATA
Definition: grpc_types.h:598
exec_ctx
grpc_core::ExecCtx exec_ctx
Definition: end2end_binder_transport_test.cc:75
grpc_op::grpc_op_data::send_message
struct grpc_op::grpc_op_data::grpc_op_send_message send_message
grpc_core::internal::alts_handshaker_client_set_grpc_caller_for_testing
void alts_handshaker_client_set_grpc_caller_for_testing(alts_handshaker_client *c, alts_grpc_caller caller)
Definition: alts_handshaker_client.cc:736
alts_handshaker_client_test_config::out_frame
grpc_slice out_frame
Definition: alts_handshaker_client_test.cc:62
grpc_gcp_StartClientHandshakeReq_max_frame_size
UPB_INLINE uint32_t grpc_gcp_StartClientHandshakeReq_max_frame_size(const grpc_gcp_StartClientHandshakeReq *msg)
Definition: handshaker.upb.h:346
grpc_gcp_NextHandshakeMessageReq_in_bytes
UPB_INLINE upb_StringView grpc_gcp_NextHandshakeMessageReq_in_bytes(const grpc_gcp_NextHandshakeMessageReq *msg)
Definition: handshaker.upb.h:722
next
AllocList * next[kMaxLevel]
Definition: abseil-cpp/absl/base/internal/low_level_alloc.cc:100
grpc::testing::TestEnvironment
Definition: test/core/util/test_config.h:54
ALTS_RECORD_PROTOCOL
#define ALTS_RECORD_PROTOCOL
Definition: alts_handshaker_client.h:35
TSI_INVALID_ARGUMENT
@ TSI_INVALID_ARGUMENT
Definition: transport_security_interface.h:34
ok
bool ok
Definition: async_end2end_test.cc:197
grpc_channel_destroy
GRPCAPI void grpc_channel_destroy(grpc_channel *channel)
Definition: channel.cc:437
closure
Definition: proxy.cc:59
schedule_request_success_test
static void schedule_request_success_test()
Definition: alts_handshaker_client_test.cc:398
grpc_core::internal::alts_handshaker_client_get_initial_metadata_for_testing
grpc_metadata_array * alts_handshaker_client_get_initial_metadata_for_testing(alts_handshaker_client *c)
Definition: alts_handshaker_client.cc:760
grpc_channel
struct grpc_channel grpc_channel
Definition: grpc_types.h:62
config_s
Definition: bloaty/third_party/zlib/deflate.c:120
kMaxRpcVersionMajor
const size_t kMaxRpcVersionMajor
Definition: alts_handshaker_client_test.cc:41
upb_StringView_FromString
UPB_INLINE upb_StringView upb_StringView_FromString(const char *data)
Definition: upb/upb/upb.h:85
tsi_cb_assert_tsi_internal_error
static void tsi_cb_assert_tsi_internal_error(tsi_result status, void *, const unsigned char *, size_t, tsi_handshaker_result *)
Definition: alts_handshaker_client_test.cc:448
check_grpc_call_failure
static grpc_call_error check_grpc_call_failure(grpc_call *, const grpc_op *op, size_t nops, grpc_closure *)
Definition: alts_handshaker_client_test.cc:283
tsi_handshaker_result
Definition: transport_security.h:121
is_recv_status_op
static bool is_recv_status_op(const grpc_op *op, size_t nops)
Definition: alts_handshaker_client_test.cc:144
grpc_gcp_rpc_protocol_versions_set_max
bool grpc_gcp_rpc_protocol_versions_set_max(grpc_gcp_rpc_protocol_versions *versions, uint32_t max_major, uint32_t max_minor)
Definition: transport_security_common_api.cc:25
ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2
#define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT2
Definition: alts_handshaker_client_test.cc:37
grpc_gcp_HandshakerReq_next
const UPB_INLINE grpc_gcp_NextHandshakeMessageReq * grpc_gcp_HandshakerReq_next(const grpc_gcp_HandshakerReq *msg)
Definition: handshaker.upb.h:794
grpc_core::internal::alts_handshaker_client_on_status_received_for_testing
void alts_handshaker_client_on_status_received_for_testing(alts_handshaker_client *c, grpc_status_code status, grpc_error_handle error)
Definition: alts_handshaker_client.cc:844
schedule_request_grpc_call_failure_test
static void schedule_request_grpc_call_failure_test()
Definition: alts_handshaker_client_test.cc:455
alts_handshaker_service_api_test_lib.h
validate_op
static bool validate_op(alts_handshaker_client *c, const grpc_op *op, size_t nops, bool is_start)
Definition: alts_handshaker_client_test.cc:102
ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1
#define ALTS_HANDSHAKER_CLIENT_TEST_TARGET_SERVICE_ACCOUNT1
Definition: alts_handshaker_client_test.cc:36
grpc_completion_queue_create_for_next
GRPCAPI grpc_completion_queue * grpc_completion_queue_create_for_next(void *reserved)
Definition: completion_queue_factory.cc:62
grpc_op::grpc_op_data::recv_initial_metadata
struct grpc_op::grpc_op_data::grpc_op_recv_initial_metadata recv_initial_metadata
grpc_gcp_ServerHandshakeParameters_record_protocols
UPB_INLINE upb_StringView const * grpc_gcp_ServerHandshakeParameters_record_protocols(const grpc_gcp_ServerHandshakeParameters *msg, size_t *len)
Definition: handshaker.upb.h:476
check_client_start_success
static grpc_call_error check_client_start_success(grpc_call *, const grpc_op *op, size_t nops, grpc_closure *closure)
Definition: alts_handshaker_client_test.cc:165
grpc_init
GRPCAPI void grpc_init(void)
Definition: init.cc:146
grpc_gcp_StartClientHandshakeReq
struct grpc_gcp_StartClientHandshakeReq grpc_gcp_StartClientHandshakeReq
Definition: handshaker.upb.h:38
GRPC_OP_RECV_STATUS_ON_CLIENT
@ GRPC_OP_RECV_STATUS_ON_CLIENT
Definition: grpc_types.h:627
_grpc_gcp_RpcProtocolVersions
Definition: transport_security_common_api.h:38
grpc_op::grpc_op_data::grpc_op_recv_initial_metadata::recv_initial_metadata
grpc_metadata_array * recv_initial_metadata
Definition: grpc_types.h:685
alts_handshaker_client_test_config::cq
grpc_completion_queue * cq
Definition: alts_handshaker_client_test.cc:59
grpc_gcp_ALTS
@ grpc_gcp_ALTS
Definition: handshaker.upb.h:65
grpc_closure
Definition: closure.h:56
op
static grpc_op * op
Definition: test/core/fling/client.cc:47
grpc_byte_buffer_reader
Definition: impl/codegen/byte_buffer_reader.h:30
upb_Arena
Definition: upb_internal.h:36
grpc_shutdown
GRPCAPI void grpc_shutdown(void)
Definition: init.cc:209
grpc_channel_credentials
Definition: src/core/lib/security/credentials/credentials.h:96
kMinRpcVersionMajor
const size_t kMinRpcVersionMajor
Definition: alts_handshaker_client_test.cc:43
grpc_gcp_RpcProtocolVersions_min_rpc_version
const UPB_INLINE grpc_gcp_RpcProtocolVersions_Version * grpc_gcp_RpcProtocolVersions_min_rpc_version(const grpc_gcp_RpcProtocolVersions *msg)
Definition: transport_security_common.upb.h:84
grpc_byte_buffer_reader_destroy
GRPCAPI void grpc_byte_buffer_reader_destroy(grpc_byte_buffer_reader *reader)
Definition: byte_buffer_reader.cc:45
create_credentials_options
static grpc_alts_credentials_options * create_credentials_options(bool is_client)
Definition: alts_handshaker_client_test.cc:293


grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:41