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

//
//
// Copyright 2018 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/local_transport_security.h"

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

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

#include "src/core/lib/gprpp/crash.h"
#include "src/core/lib/iomgr/exec_ctx.h"
#include "src/core/tsi/transport_security_grpc.h"

namespace {

// Main struct for local TSI zero-copy frame protector.
local_zero_copy_grpc_protector;

// Main struct for local TSI handshaker result.
local_tsi_handshaker_result;

// Main struct for local TSI handshaker.
local_tsi_handshaker;

// --- tsi_handshaker_result methods implementation. ---

tsi_result handshaker_result_extract_peer(const tsi_handshaker_result* /*self*/,
                                          tsi_peer* /*peer*/) {}

tsi_result handshaker_result_get_frame_protector_type(
    const tsi_handshaker_result* /*self*/,
    tsi_frame_protector_type* frame_protector_type) {}

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

void handshaker_result_destroy(tsi_handshaker_result* self) {}

const tsi_handshaker_result_vtable result_vtable =;

tsi_result create_handshaker_result(const unsigned char* received_bytes,
                                    size_t received_bytes_size,
                                    tsi_handshaker_result** self) {}

// --- tsi_handshaker methods implementation. ---

tsi_result 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** result,
                           tsi_handshaker_on_next_done_cb /*cb*/,
                           void* /*user_data*/, std::string* error) {}

void handshaker_destroy(tsi_handshaker* self) {}

const tsi_handshaker_vtable handshaker_vtable =;

}  // namespace

tsi_result tsi_local_handshaker_create(tsi_handshaker** self) {}