1 // 2 // 3 // Copyright 2018 gRPC authors. 4 // 5 // Licensed under the Apache License, Version 2.0 (the "License"); 6 // you may not use this file except in compliance with the License. 7 // You may obtain a copy of the License at 8 // 9 // http://www.apache.org/licenses/LICENSE-2.0 10 // 11 // Unless required by applicable law or agreed to in writing, software 12 // distributed under the License is distributed on an "AS IS" BASIS, 13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 14 // See the License for the specific language governing permissions and 15 // limitations under the License. 16 // 17 // 18 19 #ifndef GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H 20 #define GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H 21 22 #include "src/core/tsi/alts/handshaker/transport_security_common_api.h" 23 #include "src/proto/grpc/gcp/handshaker.upb.h" 24 25 /// 26 /// The first part of this file contains function signatures for de-serializing 27 /// ALTS handshake requests and setting/serializing ALTS handshake responses, 28 /// which simulate the behaviour of grpc server that runs ALTS handshaker 29 /// service. 30 /// 31 32 // This method sets peer_rpc_versions for ALTS handshaker response. 33 bool grpc_gcp_handshaker_resp_set_peer_rpc_versions( 34 grpc_gcp_HandshakerResp* resp, upb_Arena* arena, uint32_t max_major, 35 uint32_t max_minor, uint32_t min_major, uint32_t min_minor); 36 37 // This method de-serializes ALTS handshaker request. 38 grpc_gcp_HandshakerReq* grpc_gcp_handshaker_req_decode(grpc_slice slice, 39 upb_Arena* arena); 40 41 // This method checks equality of two ALTS handshaker responses. 42 bool grpc_gcp_handshaker_resp_equals(const grpc_gcp_HandshakerResp* l_resp, 43 const grpc_gcp_HandshakerResp* r_resp); 44 45 // This method checks equality of two handshaker response results. 46 bool grpc_gcp_handshaker_resp_result_equals( 47 const grpc_gcp_HandshakerResult* l_result, 48 const grpc_gcp_HandshakerResult* r_result); 49 50 // This method checks equality of two handshaker response statuses. 51 bool grpc_gcp_handshaker_resp_status_equals( 52 const grpc_gcp_HandshakerStatus* l_status, 53 const grpc_gcp_HandshakerStatus* r_status); 54 55 #endif // GRPC_TEST_CORE_TSI_ALTS_HANDSHAKER_ALTS_HANDSHAKER_SERVICE_API_TEST_LIB_H 56