Classes | Typedefs | Functions
transport_security_test_lib.cc File Reference
#include "test/core/tsi/transport_security_test_lib.h"
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <grpc/grpc.h>
#include <grpc/support/alloc.h>
#include <grpc/support/log.h>
#include "src/core/lib/gprpp/memory.h"
#include "src/core/lib/security/transport/tsi_error.h"
Include dependency graph for transport_security_test_lib.cc:

Go to the source code of this file.

Classes

struct  handshaker_args
 

Typedefs

typedef struct handshaker_args handshaker_args
 

Functions

static void check_handshake_results (tsi_test_fixture *fixture)
 
static void check_unused_bytes (tsi_test_fixture *fixture)
 
static void do_handshaker_next (handshaker_args *args)
 
static unsigned char * generate_random_message (size_t size)
 
static handshaker_argshandshaker_args_create (tsi_test_fixture *fixture, bool is_client)
 
static void handshaker_args_destroy (handshaker_args *args)
 
static bool is_handshake_finished_properly (handshaker_args *args)
 
static void maybe_append_unused_bytes (handshaker_args *args)
 
static void notification_signal (tsi_test_fixture *fixture)
 
static void notification_wait (tsi_test_fixture *fixture)
 
grpc_error_handle on_handshake_next_done (tsi_result result, void *user_data, const unsigned char *bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result)
 
static void on_handshake_next_done_wrapper (tsi_result result, void *user_data, const unsigned char *bytes_to_send, size_t bytes_to_send_size, tsi_handshaker_result *handshaker_result)
 
static void receive_bytes_from_peer (tsi_test_channel *test_channel, unsigned char **buf, size_t *buf_size, bool is_client)
 
static void send_bytes_to_peer (tsi_test_channel *test_channel, const unsigned char *buf, size_t buf_size, bool is_client)
 
static void setup_handshakers (tsi_test_fixture *fixture)
 
static tsi_test_channeltsi_test_channel_create ()
 
static void tsi_test_channel_destroy (tsi_test_channel *channel)
 
void tsi_test_do_handshake (tsi_test_fixture *fixture)
 
static void tsi_test_do_ping_pong (tsi_test_frame_protector_config *config, tsi_test_channel *channel, tsi_frame_protector *client_frame_protector, tsi_frame_protector *server_frame_protector)
 
void tsi_test_do_round_trip (tsi_test_fixture *fixture)
 
void tsi_test_fixture_destroy (tsi_test_fixture *fixture)
 
void tsi_test_fixture_init (tsi_test_fixture *fixture)
 
tsi_test_frame_protector_configtsi_test_frame_protector_config_create (bool use_default_read_buffer_allocated_size, bool use_default_message_buffer_allocated_size, bool use_default_protected_buffer_size, bool use_default_client_message, bool use_default_server_message, bool use_default_client_max_output_protected_frame_size, bool use_default_server_max_output_protected_frame_size)
 
void tsi_test_frame_protector_config_destroy (tsi_test_frame_protector_config *config)
 
void tsi_test_frame_protector_config_set_buffer_size (tsi_test_frame_protector_config *config, size_t read_buffer_allocated_size, size_t message_buffer_allocated_size, size_t protected_buffer_size, size_t client_max_output_protected_frame_size, size_t server_max_output_protected_frame_size)
 
void tsi_test_frame_protector_do_round_trip_no_handshake (tsi_test_frame_protector_fixture *fixture)
 
tsi_test_frame_protector_fixturetsi_test_frame_protector_fixture_create ()
 
void tsi_test_frame_protector_fixture_destroy (tsi_test_frame_protector_fixture *fixture)
 
void tsi_test_frame_protector_fixture_init (tsi_test_frame_protector_fixture *fixture, tsi_frame_protector *client_frame_protector, tsi_frame_protector *server_frame_protector)
 
void tsi_test_frame_protector_receive_message_from_peer (tsi_test_frame_protector_config *config, tsi_test_channel *channel, tsi_frame_protector *protector, unsigned char *message, size_t *bytes_received, bool is_client)
 
void tsi_test_frame_protector_send_message_to_peer (tsi_test_frame_protector_config *config, tsi_test_channel *channel, tsi_frame_protector *protector, bool is_client)
 

Typedef Documentation

◆ handshaker_args

Function Documentation

◆ check_handshake_results()

static void check_handshake_results ( tsi_test_fixture fixture)
static

Definition at line 106 of file transport_security_test_lib.cc.

◆ check_unused_bytes()

static void check_unused_bytes ( tsi_test_fixture fixture)
static

Definition at line 87 of file transport_security_test_lib.cc.

◆ do_handshaker_next()

static void do_handshaker_next ( handshaker_args args)
static

Definition at line 348 of file transport_security_test_lib.cc.

◆ generate_random_message()

static unsigned char* generate_random_message ( size_t  size)
static

Definition at line 492 of file transport_security_test_lib.cc.

◆ handshaker_args_create()

static handshaker_args* handshaker_args_create ( tsi_test_fixture fixture,
bool  is_client 
)
static

Definition at line 58 of file transport_security_test_lib.cc.

◆ handshaker_args_destroy()

static void handshaker_args_destroy ( handshaker_args args)
static

Definition at line 72 of file transport_security_test_lib.cc.

◆ is_handshake_finished_properly()

static bool is_handshake_finished_properly ( handshaker_args args)
static

Definition at line 340 of file transport_security_test_lib.cc.

◆ maybe_append_unused_bytes()

static void maybe_append_unused_bytes ( handshaker_args args)
static

Definition at line 144 of file transport_security_test_lib.cc.

◆ notification_signal()

static void notification_signal ( tsi_test_fixture fixture)
static

Definition at line 32 of file transport_security_test_lib.cc.

◆ notification_wait()

static void notification_wait ( tsi_test_fixture fixture)
static

Definition at line 39 of file transport_security_test_lib.cc.

◆ on_handshake_next_done()

grpc_error_handle on_handshake_next_done ( tsi_result  result,
void *  user_data,
const unsigned char *  bytes_to_send,
size_t  bytes_to_send_size,
tsi_handshaker_result handshaker_result 
)

Definition at line 293 of file transport_security_test_lib.cc.

◆ on_handshake_next_done_wrapper()

static void on_handshake_next_done_wrapper ( tsi_result  result,
void *  user_data,
const unsigned char *  bytes_to_send,
size_t  bytes_to_send_size,
tsi_handshaker_result handshaker_result 
)
static

Definition at line 332 of file transport_security_test_lib.cc.

◆ receive_bytes_from_peer()

static void receive_bytes_from_peer ( tsi_test_channel test_channel,
unsigned char **  buf,
size_t *  buf_size,
bool  is_client 
)
static

Definition at line 161 of file transport_security_test_lib.cc.

◆ send_bytes_to_peer()

static void send_bytes_to_peer ( tsi_test_channel test_channel,
const unsigned char *  buf,
size_t  buf_size,
bool  is_client 
)
static

Definition at line 126 of file transport_security_test_lib.cc.

◆ setup_handshakers()

static void setup_handshakers ( tsi_test_fixture fixture)
static

Definition at line 80 of file transport_security_test_lib.cc.

◆ tsi_test_channel_create()

static tsi_test_channel* tsi_test_channel_create ( )
static

Definition at line 585 of file transport_security_test_lib.cc.

◆ tsi_test_channel_destroy()

static void tsi_test_channel_destroy ( tsi_test_channel channel)
static

Definition at line 598 of file transport_security_test_lib.cc.

◆ tsi_test_do_handshake()

void tsi_test_do_handshake ( tsi_test_fixture fixture)

Definition at line 386 of file transport_security_test_lib.cc.

◆ tsi_test_do_ping_pong()

static void tsi_test_do_ping_pong ( tsi_test_frame_protector_config config,
tsi_test_channel channel,
tsi_frame_protector client_frame_protector,
tsi_frame_protector server_frame_protector 
)
static

Definition at line 415 of file transport_security_test_lib.cc.

◆ tsi_test_do_round_trip()

void tsi_test_do_round_trip ( tsi_test_fixture fixture)

Definition at line 459 of file transport_security_test_lib.cc.

◆ tsi_test_fixture_destroy()

void tsi_test_fixture_destroy ( tsi_test_fixture fixture)

Definition at line 620 of file transport_security_test_lib.cc.

◆ tsi_test_fixture_init()

void tsi_test_fixture_init ( tsi_test_fixture fixture)

Definition at line 607 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_config_create()

tsi_test_frame_protector_config* tsi_test_frame_protector_config_create ( bool  use_default_read_buffer_allocated_size,
bool  use_default_message_buffer_allocated_size,
bool  use_default_protected_buffer_size,
bool  use_default_client_message,
bool  use_default_server_message,
bool  use_default_client_max_output_protected_frame_size,
bool  use_default_server_max_output_protected_frame_size 
)

Definition at line 503 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_config_destroy()

void tsi_test_frame_protector_config_destroy ( tsi_test_frame_protector_config config)

Definition at line 575 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_config_set_buffer_size()

void tsi_test_frame_protector_config_set_buffer_size ( tsi_test_frame_protector_config config,
size_t  read_buffer_allocated_size,
size_t  message_buffer_allocated_size,
size_t  protected_buffer_size,
size_t  client_max_output_protected_frame_size,
size_t  server_max_output_protected_frame_size 
)

Definition at line 560 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_do_round_trip_no_handshake()

void tsi_test_frame_protector_do_round_trip_no_handshake ( tsi_test_frame_protector_fixture fixture)

Definition at line 451 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_fixture_create()

tsi_test_frame_protector_fixture* tsi_test_frame_protector_fixture_create ( )

Definition at line 637 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_fixture_destroy()

void tsi_test_frame_protector_fixture_destroy ( tsi_test_frame_protector_fixture fixture)

Definition at line 656 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_fixture_init()

void tsi_test_frame_protector_fixture_init ( tsi_test_frame_protector_fixture fixture,
tsi_frame_protector client_frame_protector,
tsi_frame_protector server_frame_protector 
)

Definition at line 647 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_receive_message_from_peer()

void tsi_test_frame_protector_receive_message_from_peer ( tsi_test_frame_protector_config config,
tsi_test_channel channel,
tsi_frame_protector protector,
unsigned char *  message,
size_t *  bytes_received,
bool  is_client 
)

Definition at line 237 of file transport_security_test_lib.cc.

◆ tsi_test_frame_protector_send_message_to_peer()

void tsi_test_frame_protector_send_message_to_peer ( tsi_test_frame_protector_config config,
tsi_test_channel channel,
tsi_frame_protector protector,
bool  is_client 
)

Definition at line 187 of file transport_security_test_lib.cc.



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