Go to the documentation of this file.
76 for (
size_t i = 0;
i < sb->
count;
i++) {
78 if (remaining <= slice_length) {
85 remaining -= slice_length;
91 (
static_cast<uint32_t>(frame_size_buffer[2]) << 16) |
92 (
static_cast<uint32_t>(frame_size_buffer[1]) << 8) |
93 static_cast<uint32_t>(frame_size_buffer[0]);
112 const uint8_t*
key,
size_t key_size,
bool is_rekey,
bool is_client,
113 bool is_integrity_only,
bool is_protect,
bool enable_extra_copy,
115 if (
key ==
nullptr || record_protocol ==
nullptr) {
120 char* error_details =
nullptr;
123 &crypter, &error_details);
135 crypter, overflow_limit, is_client, is_protect,
136 enable_extra_copy, record_protocol)
138 crypter, overflow_limit, is_client, is_protect,
152 if (
self ==
nullptr || unprotected_slices ==
nullptr ||
153 protected_slices ==
nullptr) {
178 if (
self ==
nullptr || unprotected_slices ==
nullptr ||
179 protected_slices ==
nullptr) {
181 "Invalid nullptr arguments to zero-copy grpc unprotect.");
218 if (min_progress_size !=
nullptr) {
223 *min_progress_size = 1;
231 if (
self ==
nullptr) {
261 const uint8_t*
key,
size_t key_size,
bool is_rekey,
bool is_client,
262 bool is_integrity_only,
bool enable_extra_copy,
263 size_t* max_protected_frame_size,
266 protector ==
nullptr) {
269 "Invalid nullptr arguments to alts_zero_copy_grpc_protector create.");
278 key, key_size, is_rekey, is_client, is_integrity_only,
282 key, key_size, is_rekey, is_client, is_integrity_only,
287 if (max_protected_frame_size !=
nullptr) {
288 *max_protected_frame_size =
290 *max_protected_frame_size =
292 max_protected_frame_size_to_set = *max_protected_frame_size;
305 *protector = &impl->
base;
GPRAPI void grpc_slice_buffer_move_into(grpc_slice_buffer *src, grpc_slice_buffer *dst)
alts_grpc_record_protocol * unrecord_protocol
static tsi_result alts_zero_copy_grpc_protector_max_frame_size(tsi_zero_copy_grpc_protector *self, size_t *max_frame_size)
grpc_slice_buffer protected_staging_sb
grpc_slice_buffer unprotected_staging_sb
const tsi_zero_copy_grpc_protector_vtable * vtable
static tsi_result create_alts_grpc_record_protocol(const uint8_t *key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool is_protect, bool enable_extra_copy, alts_grpc_record_protocol **record_protocol)
void alts_grpc_record_protocol_destroy(alts_grpc_record_protocol *self)
GPRAPI void gpr_free(void *ptr)
uint32_t parsed_frame_size
static void alts_zero_copy_grpc_protector_destroy(tsi_zero_copy_grpc_protector *self)
alts_grpc_record_protocol * record_protocol
size_t alts_grpc_record_protocol_max_unprotected_data_size(const alts_grpc_record_protocol *self, size_t max_protected_frame_size)
grpc_status_code gsec_aes_gcm_aead_crypter_create(const uint8_t *key, size_t key_length, size_t nonce_length, size_t tag_length, bool rekey, gsec_aead_crypter **crypter, char **error_details)
struct alts_zero_copy_grpc_protector alts_zero_copy_grpc_protector
GPRAPI void * gpr_zalloc(size_t size)
tsi_result alts_grpc_integrity_only_record_protocol_create(gsec_aead_crypter *crypter, size_t overflow_size, bool is_client, bool is_protect, bool enable_extra_copy, alts_grpc_record_protocol **rp)
memcpy(mem, inblock.get(), min(CONTAINING_RECORD(inblock.get(), MEMBLOCK, data) ->size, size))
const size_t kAesGcmNonceLength
static bool read_frame_size(const grpc_slice_buffer *sb, uint32_t *total_frame_size)
GPRAPI void gpr_log(const char *file, int line, gpr_log_severity severity, const char *format,...) GPR_PRINT_FORMAT_CHECK(4
static tsi_result alts_zero_copy_grpc_protector_protect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
tsi_result alts_grpc_record_protocol_protect(alts_grpc_record_protocol *self, grpc_slice_buffer *unprotected_slices, grpc_slice_buffer *protected_slices)
#define GRPC_SLICE_START_PTR(slice)
constexpr size_t kMinFrameLength
tsi_result alts_zero_copy_grpc_protector_create(const uint8_t *key, size_t key_size, bool is_rekey, bool is_client, bool is_integrity_only, bool enable_extra_copy, size_t *max_protected_frame_size, tsi_zero_copy_grpc_protector **protector)
size_t max_unprotected_data_size
static const tsi_zero_copy_grpc_protector_vtable alts_zero_copy_grpc_protector_vtable
GPRAPI void grpc_slice_buffer_init(grpc_slice_buffer *sb)
tsi_result alts_grpc_privacy_integrity_record_protocol_create(gsec_aead_crypter *crypter, size_t overflow_size, bool is_client, bool is_protect, alts_grpc_record_protocol **rp)
constexpr size_t kAltsRecordProtocolRekeyFrameLimit
#define GRPC_SLICE_LENGTH(slice)
constexpr size_t kMaxFrameLength
GPRAPI void grpc_slice_buffer_move_first(grpc_slice_buffer *src, size_t n, grpc_slice_buffer *dst)
void grpc_slice_buffer_destroy_internal(grpc_slice_buffer *sb)
size_t max_protected_frame_size
constexpr size_t kDefaultFrameLength
tsi_zero_copy_grpc_protector base
void gsec_aead_crypter_destroy(gsec_aead_crypter *crypter)
constexpr size_t kAltsRecordProtocolFrameLimit
static tsi_result alts_zero_copy_grpc_protector_unprotect(tsi_zero_copy_grpc_protector *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices, int *min_progress_size)
constexpr size_t kZeroCopyFrameLengthFieldSize
grpc_slice_buffer protected_sb
tsi_result alts_grpc_record_protocol_unprotect(alts_grpc_record_protocol *self, grpc_slice_buffer *protected_slices, grpc_slice_buffer *unprotected_slices)
void grpc_slice_buffer_reset_and_unref_internal(grpc_slice_buffer *sb)
const size_t kAesGcmTagLength
grpc
Author(s):
autogenerated on Fri May 16 2025 02:57:41