Classes | Macros | Typedefs | Enumerations | Functions | Variables
transport_security_interface.h File Reference
#include <grpc/support/port_platform.h>
#include <stdint.h>
#include <stdlib.h>
#include "src/core/lib/debug/trace.h"
Include dependency graph for transport_security_interface.h:
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  tsi_peer
 
struct  tsi_peer_property
 

Macros

#define TSI_CERTIFICATE_TYPE_PEER_PROPERTY   "certificate_type"
 
#define tsi_handshaker_is_in_progress(h)   (tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS)
 
#define TSI_SECURITY_LEVEL_PEER_PROPERTY   "security_level"
 

Typedefs

typedef struct tsi_frame_protector tsi_frame_protector
 
typedef struct tsi_handshaker tsi_handshaker
 
typedef 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)
 
typedef struct tsi_handshaker_result tsi_handshaker_result
 
typedef struct tsi_peer_property tsi_peer_property
 
typedef struct tsi_zero_copy_grpc_protector tsi_zero_copy_grpc_protector
 

Enumerations

enum  tsi_client_certificate_request_type {
  TSI_DONT_REQUEST_CLIENT_CERTIFICATE, TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY, TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY, TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY,
  TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY
}
 
enum  tsi_frame_protector_type { TSI_FRAME_PROTECTOR_NORMAL, TSI_FRAME_PROTECTOR_ZERO_COPY, TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY, TSI_FRAME_PROTECTOR_NONE }
 
enum  tsi_result {
  TSI_OK = 0, TSI_UNKNOWN_ERROR = 1, TSI_INVALID_ARGUMENT = 2, TSI_PERMISSION_DENIED = 3,
  TSI_INCOMPLETE_DATA = 4, TSI_FAILED_PRECONDITION = 5, TSI_UNIMPLEMENTED = 6, TSI_INTERNAL_ERROR = 7,
  TSI_DATA_CORRUPTED = 8, TSI_NOT_FOUND = 9, TSI_PROTOCOL_FAILURE = 10, TSI_HANDSHAKE_IN_PROGRESS = 11,
  TSI_OUT_OF_RESOURCES = 12, TSI_ASYNC = 13, TSI_HANDSHAKE_SHUTDOWN = 14, TSI_CLOSE_NOTIFY = 15,
  TSI_DRAIN_BUFFER = 16
}
 
enum  tsi_security_level {
  TSI_SECURITY_MIN, TSI_SECURITY_NONE = TSI_SECURITY_MIN, TSI_INTEGRITY_ONLY, TSI_PRIVACY_AND_INTEGRITY,
  TSI_SECURITY_MAX = TSI_PRIVACY_AND_INTEGRITY
}
 
enum  tsi_tls_version { TSI_TLS1_2, TSI_TLS1_3 }
 

Functions

void tsi_destroy ()
 
void tsi_frame_protector_destroy (tsi_frame_protector *self)
 
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_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_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)
 
tsi_result tsi_handshaker_create_frame_protector (tsi_handshaker *self, size_t *max_output_protected_frame_size, tsi_frame_protector **protector)
 
void tsi_handshaker_destroy (tsi_handshaker *self)
 
tsi_result tsi_handshaker_extract_peer (tsi_handshaker *self, tsi_peer *peer)
 
tsi_result tsi_handshaker_get_bytes_to_send_to_peer (tsi_handshaker *self, unsigned char *bytes, size_t *bytes_size)
 
tsi_result tsi_handshaker_get_result (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)
 
tsi_result tsi_handshaker_process_bytes_from_peer (tsi_handshaker *self, const unsigned char *bytes, size_t *bytes_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)
 
void tsi_handshaker_result_destroy (tsi_handshaker_result *self)
 
tsi_result tsi_handshaker_result_extract_peer (const tsi_handshaker_result *self, tsi_peer *peer)
 
tsi_result tsi_handshaker_result_get_frame_protector_type (const tsi_handshaker_result *self, tsi_frame_protector_type *frame_protector_type)
 
tsi_result tsi_handshaker_result_get_unused_bytes (const tsi_handshaker_result *self, const unsigned char **bytes, size_t *bytes_size)
 
void tsi_handshaker_shutdown (tsi_handshaker *self)
 
void tsi_init ()
 
void tsi_peer_destruct (tsi_peer *self)
 
const char * tsi_result_to_string (tsi_result result)
 
const char * tsi_security_level_to_string (tsi_security_level security_level)
 

Variables

grpc_core::TraceFlag tsi_tracing_enabled
 

Macro Definition Documentation

◆ TSI_CERTIFICATE_TYPE_PEER_PROPERTY

#define TSI_CERTIFICATE_TYPE_PEER_PROPERTY   "certificate_type"

Definition at line 223 of file transport_security_interface.h.

◆ tsi_handshaker_is_in_progress

#define tsi_handshaker_is_in_progress (   h)    (tsi_handshaker_get_result((h)) == TSI_HANDSHAKE_IN_PROGRESS)

Definition at line 423 of file transport_security_interface.h.

◆ TSI_SECURITY_LEVEL_PEER_PROPERTY

#define TSI_SECURITY_LEVEL_PEER_PROPERTY   "security_level"

Definition at line 226 of file transport_security_interface.h.

Typedef Documentation

◆ tsi_frame_protector

Definition at line 115 of file transport_security_interface.h.

◆ tsi_handshaker

Definition at line 379 of file transport_security_interface.h.

◆ tsi_handshaker_on_next_done_cb

typedef 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)

Definition at line 462 of file transport_security_interface.h.

◆ tsi_handshaker_result

Definition at line 251 of file transport_security_interface.h.

◆ tsi_peer_property

◆ tsi_zero_copy_grpc_protector

Definition at line 108 of file transport_security_interface.h.

Enumeration Type Documentation

◆ tsi_client_certificate_request_type

Enumerator
TSI_DONT_REQUEST_CLIENT_CERTIFICATE 
TSI_REQUEST_CLIENT_CERTIFICATE_BUT_DONT_VERIFY 
TSI_REQUEST_CLIENT_CERTIFICATE_AND_VERIFY 
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_BUT_DONT_VERIFY 
TSI_REQUEST_AND_REQUIRE_CLIENT_CERTIFICATE_AND_VERIFY 

Definition at line 60 of file transport_security_interface.h.

◆ tsi_frame_protector_type

Enumerator
TSI_FRAME_PROTECTOR_NORMAL 
TSI_FRAME_PROTECTOR_ZERO_COPY 
TSI_FRAME_PROTECTOR_NORMAL_OR_ZERO_COPY 
TSI_FRAME_PROTECTOR_NONE 

Definition at line 69 of file transport_security_interface.h.

◆ tsi_result

enum tsi_result
Enumerator
TSI_OK 
TSI_UNKNOWN_ERROR 
TSI_INVALID_ARGUMENT 
TSI_PERMISSION_DENIED 
TSI_INCOMPLETE_DATA 
TSI_FAILED_PRECONDITION 
TSI_UNIMPLEMENTED 
TSI_INTERNAL_ERROR 
TSI_DATA_CORRUPTED 
TSI_NOT_FOUND 
TSI_PROTOCOL_FAILURE 
TSI_HANDSHAKE_IN_PROGRESS 
TSI_OUT_OF_RESOURCES 
TSI_ASYNC 
TSI_HANDSHAKE_SHUTDOWN 
TSI_CLOSE_NOTIFY 
TSI_DRAIN_BUFFER 

Definition at line 31 of file transport_security_interface.h.

◆ tsi_security_level

Enumerator
TSI_SECURITY_MIN 
TSI_SECURITY_NONE 
TSI_INTEGRITY_ONLY 
TSI_PRIVACY_AND_INTEGRITY 
TSI_SECURITY_MAX 

Definition at line 52 of file transport_security_interface.h.

◆ tsi_tls_version

Enumerator
TSI_TLS1_2 
TSI_TLS1_3 

Definition at line 89 of file transport_security_interface.h.

Function Documentation

◆ tsi_destroy()

void tsi_destroy ( )

◆ tsi_frame_protector_destroy()

void tsi_frame_protector_destroy ( tsi_frame_protector self)

Definition at line 135 of file transport_security.cc.

◆ tsi_frame_protector_protect()

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 
)

Definition at line 87 of file transport_security.cc.

◆ tsi_frame_protector_protect_flush()

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 
)

Definition at line 104 of file transport_security.cc.

◆ tsi_frame_protector_unprotect()

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 
)

Definition at line 119 of file transport_security.cc.

◆ tsi_handshaker_create_frame_protector()

tsi_result tsi_handshaker_create_frame_protector ( tsi_handshaker self,
size_t *  max_output_protected_frame_size,
tsi_frame_protector **  protector 
)

Definition at line 196 of file transport_security.cc.

◆ tsi_handshaker_destroy()

void tsi_handshaker_destroy ( tsi_handshaker self)

Definition at line 237 of file transport_security.cc.

◆ tsi_handshaker_extract_peer()

tsi_result tsi_handshaker_extract_peer ( tsi_handshaker self,
tsi_peer peer 
)

Definition at line 182 of file transport_security.cc.

◆ tsi_handshaker_get_bytes_to_send_to_peer()

tsi_result tsi_handshaker_get_bytes_to_send_to_peer ( tsi_handshaker self,
unsigned char *  bytes,
size_t *  bytes_size 
)

Definition at line 144 of file transport_security.cc.

◆ tsi_handshaker_get_result()

tsi_result tsi_handshaker_get_result ( tsi_handshaker self)

Definition at line 174 of file transport_security.cc.

◆ tsi_handshaker_next()

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 
)

Definition at line 215 of file transport_security.cc.

◆ tsi_handshaker_process_bytes_from_peer()

tsi_result tsi_handshaker_process_bytes_from_peer ( tsi_handshaker self,
const unsigned char *  bytes,
size_t *  bytes_size 
)

Definition at line 159 of file transport_security.cc.

◆ tsi_handshaker_result_create_frame_protector()

tsi_result tsi_handshaker_result_create_frame_protector ( const tsi_handshaker_result self,
size_t *  max_output_protected_frame_size,
tsi_frame_protector **  protector 
)

Definition at line 266 of file transport_security.cc.

◆ tsi_handshaker_result_destroy()

void tsi_handshaker_result_destroy ( tsi_handshaker_result self)

Definition at line 288 of file transport_security.cc.

◆ tsi_handshaker_result_extract_peer()

tsi_result tsi_handshaker_result_extract_peer ( const tsi_handshaker_result self,
tsi_peer peer 
)

Definition at line 244 of file transport_security.cc.

◆ tsi_handshaker_result_get_frame_protector_type()

tsi_result tsi_handshaker_result_get_frame_protector_type ( const tsi_handshaker_result self,
tsi_frame_protector_type frame_protector_type 
)

Definition at line 254 of file transport_security.cc.

◆ tsi_handshaker_result_get_unused_bytes()

tsi_result tsi_handshaker_result_get_unused_bytes ( const tsi_handshaker_result self,
const unsigned char **  bytes,
size_t *  bytes_size 
)

Definition at line 277 of file transport_security.cc.

◆ tsi_handshaker_shutdown()

void tsi_handshaker_shutdown ( tsi_handshaker self)

Definition at line 229 of file transport_security.cc.

◆ tsi_init()

void tsi_init ( )

◆ tsi_peer_destruct()

void tsi_peer_destruct ( tsi_peer self)

Definition at line 320 of file transport_security.cc.

◆ tsi_result_to_string()

const char* tsi_result_to_string ( tsi_result  result)

Definition at line 35 of file transport_security.cc.

◆ tsi_security_level_to_string()

const char* tsi_security_level_to_string ( tsi_security_level  security_level)

Definition at line 70 of file transport_security.cc.

Variable Documentation

◆ tsi_tracing_enabled

grpc_core::TraceFlag tsi_tracing_enabled


grpc
Author(s):
autogenerated on Fri May 16 2025 03:01:35