diff options
Diffstat (limited to 'src/core/tsi/transport_security.c')
-rw-r--r-- | src/core/tsi/transport_security.c | 35 |
1 files changed, 12 insertions, 23 deletions
diff --git a/src/core/tsi/transport_security.c b/src/core/tsi/transport_security.c index 94252e36d0..5a42f03f5f 100644 --- a/src/core/tsi/transport_security.c +++ b/src/core/tsi/transport_security.c @@ -44,7 +44,7 @@ char* tsi_strdup(const char* src) { if (!src) return NULL; len = strlen(src) + 1; dst = malloc(len); - if (!dst) return NULL; + if (!dst) return NULL; memcpy(dst, src, len); return dst; } @@ -84,17 +84,15 @@ const char* tsi_result_to_string(tsi_result result) { } } - /* --- tsi_frame_protector common implementation. --- Calls specific implementation after state/input validation. */ -tsi_result tsi_frame_protector_protect( - tsi_frame_protector* self, - const unsigned char* unprotected_bytes, - uint32_t* unprotected_bytes_size, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size) { +tsi_result tsi_frame_protector_protect(tsi_frame_protector* self, + const unsigned char* unprotected_bytes, + uint32_t* unprotected_bytes_size, + unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size) { if (self == NULL || unprotected_bytes == NULL || unprotected_bytes_size == NULL || protected_output_frames == NULL || protected_output_frames_size == NULL) { @@ -106,10 +104,8 @@ tsi_result tsi_frame_protector_protect( } tsi_result tsi_frame_protector_protect_flush( - tsi_frame_protector* self, - unsigned char* protected_output_frames, - uint32_t* protected_output_frames_size, - uint32_t* still_pending_size) { + tsi_frame_protector* self, unsigned char* protected_output_frames, + uint32_t* protected_output_frames_size, uint32_t* still_pending_size) { if (self == NULL || protected_output_frames == NULL || protected_output_frames == NULL || still_pending_size == NULL) { return TSI_INVALID_ARGUMENT; @@ -120,10 +116,8 @@ tsi_result tsi_frame_protector_protect_flush( } tsi_result tsi_frame_protector_unprotect( - tsi_frame_protector* self, - const unsigned char* protected_frames_bytes, - uint32_t* protected_frames_bytes_size, - unsigned char* unprotected_bytes, + tsi_frame_protector* self, const unsigned char* protected_frames_bytes, + uint32_t* protected_frames_bytes_size, unsigned char* unprotected_bytes, uint32_t* unprotected_bytes_size) { if (self == NULL || protected_frames_bytes == NULL || protected_frames_bytes_size == NULL || unprotected_bytes == NULL || @@ -140,7 +134,6 @@ void tsi_frame_protector_destroy(tsi_frame_protector* self) { self->vtable->destroy(self); } - /* --- tsi_handshaker common implementation. --- Calls specific implementation after state/input validation. */ @@ -153,7 +146,6 @@ tsi_result tsi_handshaker_get_bytes_to_send_to_peer(tsi_handshaker* self, return self->vtable->get_bytes_to_send_to_peer(self, bytes, bytes_size); } - tsi_result tsi_handshaker_process_bytes_from_peer(tsi_handshaker* self, const unsigned char* bytes, uint32_t* bytes_size) { @@ -179,8 +171,7 @@ tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) { } tsi_result tsi_handshaker_create_frame_protector( - tsi_handshaker* self, - uint32_t* max_protected_frame_size, + tsi_handshaker* self, uint32_t* max_protected_frame_size, tsi_frame_protector** protector) { tsi_result result; if (self == NULL || protector == NULL) return TSI_INVALID_ARGUMENT; @@ -201,7 +192,6 @@ void tsi_handshaker_destroy(tsi_handshaker* self) { self->vtable->destroy(self); } - /* --- tsi_peer implementation. --- */ const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* self, @@ -227,7 +217,6 @@ tsi_peer_property tsi_init_peer_property(void) { return property; } - static void tsi_peer_destroy_list_property(tsi_peer_property* children, uint32_t child_count) { uint32_t i; @@ -254,7 +243,7 @@ void tsi_peer_property_destruct(tsi_peer_property* property) { /* Nothing to free. */ break; } - *property = tsi_init_peer_property(); /* Reset everything to 0. */ + *property = tsi_init_peer_property(); /* Reset everything to 0. */ } void tsi_peer_destruct(tsi_peer* self) { |