#include <grpc/support/port_platform.h>
#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include "upb/upb.hpp"
#include <grpc/grpc_security.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include <grpc/support/string_util.h>
#include <grpc/support/sync.h>
#include <grpc/support/thd_id.h>
#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/gprpp/sync.h"
#include "src/core/lib/gprpp/thd.h"
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/slice/slice_internal.h"
#include "src/core/lib/surface/channel.h"
#include "src/core/tsi/alts/frame_protector/alts_frame_protector.h"
#include "src/core/tsi/alts/handshaker/alts_handshaker_client.h"
#include "src/core/tsi/alts/handshaker/alts_shared_resource.h"
#include "src/core/tsi/alts/handshaker/alts_tsi_utils.h"
#include "src/core/tsi/alts/zero_copy_frame_protector/alts_zero_copy_grpc_protector.h"
struct alts_tsi_handshaker { … };
alts_tsi_handshaker_result;
static tsi_result handshaker_result_extract_peer(
const tsi_handshaker_result* self, tsi_peer* peer) { … }
static tsi_result handshaker_result_get_frame_protector_type(
const tsi_handshaker_result* ,
tsi_frame_protector_type* frame_protector_type) { … }
static tsi_result handshaker_result_create_zero_copy_grpc_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_zero_copy_grpc_protector** protector) { … }
static tsi_result handshaker_result_create_frame_protector(
const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
tsi_frame_protector** protector) { … }
static tsi_result handshaker_result_get_unused_bytes(
const tsi_handshaker_result* self, const unsigned char** bytes,
size_t* bytes_size) { … }
static void handshaker_result_destroy(tsi_handshaker_result* self) { … }
static const tsi_handshaker_result_vtable result_vtable = …;
tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
bool is_client,
tsi_handshaker_result** result) { … }
static void on_handshaker_service_resp_recv(void* arg,
grpc_error_handle error) { … }
static void on_handshaker_service_resp_recv_dedicated(
void* arg, grpc_error_handle ) { … }
static tsi_result alts_tsi_handshaker_continue_handshaker_next(
alts_tsi_handshaker* handshaker, const unsigned char* received_bytes,
size_t received_bytes_size, tsi_handshaker_on_next_done_cb cb,
void* user_data, std::string* error) { … }
struct alts_tsi_handshaker_continue_handshaker_next_args { … };
static void alts_tsi_handshaker_create_channel(
void* arg, grpc_error_handle ) { … }
static tsi_result handshaker_next(
tsi_handshaker* self, const unsigned char* received_bytes,
size_t received_bytes_size, const unsigned char** ,
size_t* , tsi_handshaker_result** ,
tsi_handshaker_on_next_done_cb cb, void* user_data, std::string* error) { … }
static tsi_result handshaker_next_dedicated(
tsi_handshaker* self, const unsigned char* received_bytes,
size_t received_bytes_size, const unsigned char** bytes_to_send,
size_t* bytes_to_send_size, tsi_handshaker_result** result,
tsi_handshaker_on_next_done_cb cb, void* user_data, std::string* error) { … }
static void handshaker_shutdown(tsi_handshaker* self) { … }
static void handshaker_destroy(tsi_handshaker* self) { … }
static const tsi_handshaker_vtable handshaker_vtable = …;
static const tsi_handshaker_vtable handshaker_vtable_dedicated = …;
bool alts_tsi_handshaker_has_shutdown(alts_tsi_handshaker* handshaker) { … }
tsi_result alts_tsi_handshaker_create(
const grpc_alts_credentials_options* options, const char* target_name,
const char* handshaker_service_url, bool is_client,
grpc_pollset_set* interested_parties, tsi_handshaker** self,
size_t user_specified_max_frame_size) { … }
void alts_tsi_handshaker_result_set_unused_bytes(tsi_handshaker_result* result,
grpc_slice* recv_bytes,
size_t bytes_consumed) { … }
namespace grpc_core {
namespace internal {
bool alts_tsi_handshaker_get_has_sent_start_message_for_testing(
alts_tsi_handshaker* handshaker) { … }
void alts_tsi_handshaker_set_client_vtable_for_testing(
alts_tsi_handshaker* handshaker, alts_handshaker_client_vtable* vtable) { … }
bool alts_tsi_handshaker_get_is_client_for_testing(
alts_tsi_handshaker* handshaker) { … }
alts_handshaker_client* alts_tsi_handshaker_get_client_for_testing(
alts_tsi_handshaker* handshaker) { … }
}
}