#include <grpc/support/port_platform.h>
#include <grpc/byte_buffer.h>
#include <grpc/byte_buffer_reader.h>
#include <grpc/grpc.h>
#include "src/core/lib/iomgr/closure.h"
#include "src/core/lib/iomgr/pollset_set.h"
#include "src/core/tsi/alts/handshaker/alts_tsi_handshaker.h"
#include "src/core/tsi/transport_security_interface.h"
Go to the source code of this file.
Classes | |
struct | alts_handshaker_client_vtable |
Macros | |
#define | ALTS_APPLICATION_PROTOCOL "grpc" |
#define | ALTS_HANDSHAKER_SERVICE_URL_FOR_TESTING "lame" |
#define | ALTS_RECORD_PROTOCOL "ALTSRP_GCM_AES128_REKEY" |
#define | ALTS_SERVICE_METHOD "/grpc.gcp.HandshakerService/DoHandshake" |
Typedefs | |
typedef grpc_call_error(* | alts_grpc_caller) (grpc_call *call, const grpc_op *ops, size_t nops, grpc_closure *tag) |
typedef struct alts_handshaker_client | alts_handshaker_client |
typedef struct alts_handshaker_client_vtable | alts_handshaker_client_vtable |
typedef struct alts_tsi_handshaker | alts_tsi_handshaker |
Functions | |
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) |
void | alts_handshaker_client_destroy (alts_handshaker_client *client) |
void | alts_handshaker_client_handle_response (alts_handshaker_client *client, bool is_ok) |
tsi_result | alts_handshaker_client_next (alts_handshaker_client *client, grpc_slice *bytes_received) |
void | alts_handshaker_client_shutdown (alts_handshaker_client *client) |
tsi_result | alts_handshaker_client_start_client (alts_handshaker_client *client) |
tsi_result | alts_handshaker_client_start_server (alts_handshaker_client *client, grpc_slice *bytes_received) |
Variables | |
const size_t | kAltsAes128GcmRekeyKeyLength = 44 |
#define ALTS_APPLICATION_PROTOCOL "grpc" |
Definition at line 34 of file alts_handshaker_client.h.
#define ALTS_HANDSHAKER_SERVICE_URL_FOR_TESTING "lame" |
Definition at line 36 of file alts_handshaker_client.h.
#define ALTS_RECORD_PROTOCOL "ALTSRP_GCM_AES128_REKEY" |
Definition at line 35 of file alts_handshaker_client.h.
#define ALTS_SERVICE_METHOD "/grpc.gcp.HandshakerService/DoHandshake" |
Definition at line 33 of file alts_handshaker_client.h.
typedef grpc_call_error(* alts_grpc_caller) (grpc_call *call, const grpc_op *ops, size_t nops, grpc_closure *tag) |
Definition at line 50 of file alts_handshaker_client.h.
typedef struct alts_handshaker_client alts_handshaker_client |
A ALTS handshaker client interface. It is used to communicate with ALTS handshaker service by scheduling a handshaker request that could be one of client_start, server_start, and next handshaker requests. All APIs in the header are thread-compatible.
Definition at line 47 of file alts_handshaker_client.h.
typedef struct alts_handshaker_client_vtable alts_handshaker_client_vtable |
typedef struct alts_tsi_handshaker alts_tsi_handshaker |
Definition at line 40 of file alts_handshaker_client.h.
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 | ||
) |
This method creates an ALTS handshaker client.
It returns the created ALTS handshaker client on success, and NULL on failure.
Definition at line 687 of file alts_handshaker_client.cc.
void alts_handshaker_client_destroy | ( | alts_handshaker_client * | client | ) |
This method destroys an ALTS handshaker client.
Definition at line 902 of file alts_handshaker_client.cc.
void alts_handshaker_client_handle_response | ( | alts_handshaker_client * | client, |
bool | is_ok | ||
) |
This method handles handshaker response returned from ALTS handshaker service. Note that the only reason the API is exposed is that it is used in alts_shared_resources.cc.
Definition at line 190 of file alts_handshaker_client.cc.
tsi_result alts_handshaker_client_next | ( | alts_handshaker_client * | client, |
grpc_slice * | bytes_received | ||
) |
This method schedules a next handshaker request to ALTS handshaker service.
It returns TSI_OK on success and an error status code on failure.
Definition at line 884 of file alts_handshaker_client.cc.
void alts_handshaker_client_shutdown | ( | alts_handshaker_client * | client | ) |
This method cancels previously scheduled, but yet executed handshaker requests to ALTS handshaker service. After this operation, the handshake will be shutdown, and no more handshaker requests will get scheduled.
Definition at line 895 of file alts_handshaker_client.cc.
tsi_result alts_handshaker_client_start_client | ( | alts_handshaker_client * | client | ) |
This method schedules a client_start handshaker request to ALTS handshaker service.
It returns TSI_OK on success and an error status code on failure.
Definition at line 863 of file alts_handshaker_client.cc.
tsi_result alts_handshaker_client_start_server | ( | alts_handshaker_client * | client, |
grpc_slice * | bytes_received | ||
) |
This method schedules a server_start handshaker request to ALTS handshaker service.
It returns TSI_OK on success and an error status code on failure.
Definition at line 873 of file alts_handshaker_client.cc.
const size_t kAltsAes128GcmRekeyKeyLength = 44 |
Definition at line 38 of file alts_handshaker_client.h.