Danny Reidenbach 5 жил өмнө
parent
commit
1bda8d61e2

+ 0 - 4
src/core/tsi/alts/handshaker/alts_handshaker_client.cc

@@ -270,12 +270,10 @@ void alts_handshaker_client_handle_response(alts_handshaker_client* c,
       handle_response_done(client, status, nullptr, 0, nullptr);
       return;
     }
-
     alts_tsi_handshaker_result_set_unused_bytes(
         result, &client->recv_bytes,
         grpc_gcp_HandshakerResp_bytes_consumed(resp));
   }
-
   grpc_status_code code = static_cast<grpc_status_code>(
       grpc_gcp_HandshakerStatus_code(resp_status));
   if (code != GRPC_STATUS_OK) {
@@ -551,10 +549,8 @@ static grpc_byte_buffer* get_serialized_start_server(
   GPR_ASSERT(bytes_received != nullptr);
   alts_grpc_handshaker_client* client =
       reinterpret_cast<alts_grpc_handshaker_client*>(c);
-
   upb::Arena arena;
   grpc_gcp_HandshakerReq* req = grpc_gcp_HandshakerReq_new(arena.ptr());
-
   grpc_gcp_StartServerHandshakeReq* start_server =
       grpc_gcp_HandshakerReq_mutable_server_start(req, arena.ptr());
   grpc_gcp_StartServerHandshakeReq_add_application_protocols(

+ 1 - 2
src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc

@@ -339,8 +339,7 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
     gpr_log(GPR_ERROR, "Null peer identity in ALTS context.");
     return TSI_FAILED_PRECONDITION;
   }
-  if (grpc_gcp_Identity_has_attributes(
-          const_cast<grpc_gcp_Identity*>(peer_identity))) {
+  if (grpc_gcp_Identity_has_attributes(identity)) {
     size_t iter = UPB_MAP_BEGIN;
     grpc_gcp_Identity_AttributesEntry* peer_attributes_entry =
         grpc_gcp_Identity_attributes_nextmutable(peer_identity, &iter);

+ 0 - 2
test/core/tsi/alts/handshaker/alts_tsi_handshaker_test.cc

@@ -134,7 +134,6 @@ static grpc_byte_buffer* generate_handshaker_response(
       grpc_gcp_HandshakerResp_mutable_status(resp, arena.ptr());
   grpc_gcp_HandshakerStatus_set_code(status, 0);
   grpc_gcp_Identity* local_identity;
-
   switch (type) {
     case INVALID:
       break;
@@ -434,7 +433,6 @@ static void on_server_next_success_cb(tsi_result status, void* user_data,
                     peer_account.size) == 0);
   GPR_ASSERT(memcmp(ALTS_TSI_HANDSHAKER_TEST_LOCAL_IDENTITY, local_account.data,
                     local_account.size) == 0);
-
   size_t iter = UPB_MAP_BEGIN;
   grpc_gcp_AltsContext_PeerAttributesEntry* peer_attributes_entry =
       grpc_gcp_AltsContext_peer_attributes_nextmutable(ctx, &iter);