chromium/third_party/grpc/src/src/core/tsi/transport_security.cc

//
//
// Copyright 2015 gRPC authors.
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
//     http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
//
//

#include <grpc/support/port_platform.h>

#include "src/core/tsi/transport_security.h"

#include <stdlib.h>
#include <string.h>

#include <grpc/support/alloc.h>
#include <grpc/support/string_util.h>

// --- Tracing. ---

grpc_core::TraceFlag tsi_tracing_enabled(false, "tsi");

// --- tsi_result common implementation. ---

const char* tsi_result_to_string(tsi_result result) {}

const char* tsi_security_level_to_string(tsi_security_level security_level) {}

// --- 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,
                                       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) {}

void tsi_frame_protector_destroy(tsi_frame_protector* self) {}

// --- tsi_handshaker common implementation. ---

// Calls specific implementation after state/input validation.

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

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

tsi_result tsi_handshaker_get_result(tsi_handshaker* self) {}

tsi_result tsi_handshaker_extract_peer(tsi_handshaker* self, tsi_peer* peer) {}

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

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, std::string* error) {}

void tsi_handshaker_shutdown(tsi_handshaker* self) {}

void tsi_handshaker_destroy(tsi_handshaker* self) {}

// --- tsi_handshaker_result implementation. ---

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_create_frame_protector(
    const tsi_handshaker_result* self, size_t* max_output_protected_frame_size,
    tsi_frame_protector** protector) {}

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

void tsi_handshaker_result_destroy(tsi_handshaker_result* self) {}

// --- tsi_peer implementation. ---

tsi_peer_property tsi_init_peer_property(void) {}

static void tsi_peer_destroy_list_property(tsi_peer_property* children,
                                           size_t child_count) {}

void tsi_peer_property_destruct(tsi_peer_property* property) {}

void tsi_peer_destruct(tsi_peer* self) {}

tsi_result tsi_construct_allocated_string_peer_property(
    const char* name, size_t value_length, tsi_peer_property* property) {}

tsi_result tsi_construct_string_peer_property_from_cstring(
    const char* name, const char* value, tsi_peer_property* property) {}

tsi_result tsi_construct_string_peer_property(const char* name,
                                              const char* value,
                                              size_t value_length,
                                              tsi_peer_property* property) {}

tsi_result tsi_construct_peer(size_t property_count, tsi_peer* peer) {}

const tsi_peer_property* tsi_peer_get_property_by_name(const tsi_peer* peer,
                                                       const char* name) {}