Go to the documentation of this file.
40 return "TSI_UNKNOWN_ERROR";
42 return "TSI_INVALID_ARGUMENT";
44 return "TSI_PERMISSION_DENIED";
46 return "TSI_INCOMPLETE_DATA";
48 return "TSI_FAILED_PRECONDITION";
50 return "TSI_UNIMPLEMENTED";
52 return "TSI_INTERNAL_ERROR";
54 return "TSI_DATA_CORRUPTED";
56 return "TSI_NOT_FOUND";
58 return "TSI_PROTOCOL_FAILURE";
60 return "TSI_HANDSHAKE_IN_PROGRESS";
62 return "TSI_OUT_OF_RESOURCES";
71 switch (security_level) {
73 return "TSI_SECURITY_NONE";
75 return "TSI_INTEGRITY_ONLY";
77 return "TSI_PRIVACY_AND_INTEGRITY";
88 const unsigned char* unprotected_bytes,
89 size_t* unprotected_bytes_size,
90 unsigned char* protected_output_frames,
91 size_t* protected_output_frames_size) {
92 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
93 unprotected_bytes ==
nullptr || unprotected_bytes_size ==
nullptr ||
94 protected_output_frames ==
nullptr ||
95 protected_output_frames_size ==
nullptr) {
99 return self->vtable->protect(
self, unprotected_bytes, unprotected_bytes_size,
100 protected_output_frames,
101 protected_output_frames_size);
106 size_t* protected_output_frames_size,
size_t* still_pending_size) {
107 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
108 protected_output_frames ==
nullptr ||
109 protected_output_frames_size ==
nullptr ||
110 still_pending_size ==
nullptr) {
114 return self->vtable->protect_flush(
self, protected_output_frames,
115 protected_output_frames_size,
121 size_t* protected_frames_bytes_size,
unsigned char* unprotected_bytes,
122 size_t* unprotected_bytes_size) {
123 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
124 protected_frames_bytes ==
nullptr ||
125 protected_frames_bytes_size ==
nullptr || unprotected_bytes ==
nullptr ||
126 unprotected_bytes_size ==
nullptr) {
130 return self->vtable->unprotect(
self, protected_frames_bytes,
131 protected_frames_bytes_size, unprotected_bytes,
132 unprotected_bytes_size);
136 if (
self ==
nullptr)
return;
137 self->vtable->destroy(
self);
145 unsigned char*
bytes,
146 size_t* bytes_size) {
147 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
bytes ==
nullptr ||
148 bytes_size ==
nullptr) {
153 if (
self->vtable->get_bytes_to_send_to_peer ==
nullptr) {
156 return self->vtable->get_bytes_to_send_to_peer(
self,
bytes, bytes_size);
160 const unsigned char*
bytes,
161 size_t* bytes_size) {
162 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
bytes ==
nullptr ||
163 bytes_size ==
nullptr) {
168 if (
self->vtable->process_bytes_from_peer ==
nullptr) {
171 return self->vtable->process_bytes_from_peer(
self,
bytes, bytes_size);
179 return self->vtable->get_result(
self);
183 if (
self ==
nullptr ||
self->vtable ==
nullptr || peer ==
nullptr) {
193 return self->vtable->extract_peer(
self, peer);
200 if (
self ==
nullptr ||
self->vtable ==
nullptr || protector ==
nullptr) {
207 result =
self->vtable->create_frame_protector(
208 self, max_output_protected_frame_size, protector);
210 self->frame_protector_created =
true;
217 size_t received_bytes_size,
const unsigned char** bytes_to_send,
224 return self->vtable->next(
self, received_bytes, received_bytes_size,
225 bytes_to_send, bytes_to_send_size,
226 handshaker_result,
cb, user_data);
230 if (
self ==
nullptr ||
self->vtable ==
nullptr)
return;
231 if (
self->vtable->shutdown !=
nullptr) {
232 self->vtable->shutdown(
self);
234 self->handshake_shutdown =
true;
238 if (
self ==
nullptr)
return;
239 self->vtable->destroy(
self);
246 if (
self ==
nullptr ||
self->vtable ==
nullptr || peer ==
nullptr) {
251 return self->vtable->extract_peer(
self, peer);
257 if (
self ==
nullptr || frame_protector_type ==
nullptr) {
260 if (
self->vtable->get_frame_protector_type ==
nullptr) {
263 return self->vtable->get_frame_protector_type(
self, frame_protector_type);
269 if (
self ==
nullptr ||
self->vtable ==
nullptr || protector ==
nullptr) {
273 return self->vtable->create_frame_protector(
274 self, max_output_protected_frame_size, protector);
279 size_t* bytes_size) {
280 if (
self ==
nullptr ||
self->vtable ==
nullptr ||
bytes ==
nullptr ||
281 bytes_size ==
nullptr) {
285 return self->vtable->get_unused_bytes(
self,
bytes, bytes_size);
289 if (
self ==
nullptr)
return;
290 self->vtable->destroy(
self);
302 size_t child_count) {
304 for (
i = 0;
i < child_count;
i++) {
311 if (property->
name !=
nullptr) {
321 if (
self ==
nullptr)
return;
322 if (
self->properties !=
nullptr) {
324 self->properties =
nullptr;
326 self->property_count = 0;
333 if (value_length > 0) {
334 property->value.data =
static_cast<char*
>(
gpr_zalloc(value_length));
335 property->value.length = value_length;
351 name, value_length, property);
353 if (value_length > 0) {
361 if (property_count > 0) {
372 if (peer ==
nullptr)
return nullptr;
375 if (
name ==
nullptr && property->name ==
nullptr) {
378 if (
name !=
nullptr && property->name !=
nullptr &&
379 strcmp(property->name,
name) == 0) {
const char * tsi_security_level_to_string(tsi_security_level security_level)
void tsi_peer_property_destruct(tsi_peer_property *property)
tsi_peer_property * properties
struct tsi_peer_property::@48 value
return memset(p, 0, total)
grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi")
void tsi_handshaker_destroy(tsi_handshaker *self)
tsi_result tsi_handshaker_result_get_unused_bytes(const tsi_handshaker_result *self, const unsigned char **bytes, size_t *bytes_size)
GPRAPI void gpr_free(void *ptr)
static void tsi_peer_destroy_list_property(tsi_peer_property *children, size_t child_count)
@ TSI_FAILED_PRECONDITION
tsi_result tsi_frame_protector_protect_flush(tsi_frame_protector *self, unsigned char *protected_output_frames, size_t *protected_output_frames_size, size_t *still_pending_size)
tsi_result tsi_handshaker_result_get_frame_protector_type(const tsi_handshaker_result *self, tsi_frame_protector_type *frame_protector_type)
tsi_result tsi_frame_protector_unprotect(tsi_frame_protector *self, const unsigned char *protected_frames_bytes, size_t *protected_frames_bytes_size, unsigned char *unprotected_bytes, size_t *unprotected_bytes_size)
GPRAPI void * gpr_zalloc(size_t size)
tsi_result tsi_construct_allocated_string_peer_property(const char *name, size_t value_length, tsi_peer_property *property)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
tsi_result tsi_handshaker_create_frame_protector(tsi_handshaker *self, size_t *max_output_protected_frame_size, tsi_frame_protector **protector)
tsi_peer_property tsi_init_peer_property(void)
void(* tsi_handshaker_on_next_done_cb)(tsi_result status, void *user_data, const unsigned char *bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result)
const tsi_peer_property * tsi_peer_get_property_by_name(const tsi_peer *peer, const char *name)
tsi_result tsi_handshaker_extract_peer(tsi_handshaker *self, tsi_peer *peer)
tsi_result tsi_handshaker_result_extract_peer(const tsi_handshaker_result *self, tsi_peer *peer)
void tsi_handshaker_shutdown(tsi_handshaker *self)
tsi_result tsi_handshaker_next(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 **handshaker_result, tsi_handshaker_on_next_done_cb cb, void *user_data)
void tsi_handshaker_result_destroy(tsi_handshaker_result *self)
tsi_result tsi_handshaker_get_result(tsi_handshaker *self)
const char * tsi_result_to_string(tsi_result result)
tsi_result tsi_frame_protector_protect(tsi_frame_protector *self, const unsigned char *unprotected_bytes, size_t *unprotected_bytes_size, unsigned char *protected_output_frames, size_t *protected_output_frames_size)
tsi_result tsi_handshaker_result_create_frame_protector(const tsi_handshaker_result *self, size_t *max_output_protected_frame_size, tsi_frame_protector **protector)
tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_size)
GPRAPI char * gpr_strdup(const char *src)
@ TSI_PRIVACY_AND_INTEGRITY
void tsi_frame_protector_destroy(tsi_frame_protector *self)
tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker *self, unsigned char *bytes, size_t *bytes_size)
PHP_PROTO_OBJECT_FREE_END PHP_PROTO_OBJECT_DTOR_END intern self
std::map< std::string, Node * > children
void tsi_peer_destruct(tsi_peer *self)
tsi_result tsi_construct_string_peer_property(const char *name, const char *value, size_t value_length, tsi_peer_property *property)
OPENSSL_EXPORT pem_password_cb * cb
tsi_result tsi_construct_string_peer_property_from_cstring(const char *name, const char *value, tsi_peer_property *property)
tsi_result tsi_construct_peer(size_t property_count, tsi_peer *peer)
@ TSI_HANDSHAKE_IN_PROGRESS
grpc
Author(s):
autogenerated on Fri May 16 2025 03:00:40