Merge pull request #21087 from ZhenLian/zhen_alts_context_C++

Patch for PR#20873
reviewable/pr21119/r1
ZhenLian 5 years ago committed by GitHub
commit 4baad81c57
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 8
      src/core/tsi/alts/handshaker/alts_tsi_handshaker.cc

@ -267,10 +267,8 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
} }
upb_strview local_service_account = upb_strview local_service_account =
grpc_gcp_Identity_service_account(local_identity); grpc_gcp_Identity_service_account(local_identity);
if (local_service_account.size == 0) { // We don't check if local service account is empty here
gpr_log(GPR_ERROR, "Invalid local service account"); // because local identity could be empty in certain situations.
return TSI_FAILED_PRECONDITION;
}
alts_tsi_handshaker_result* result = alts_tsi_handshaker_result* result =
static_cast<alts_tsi_handshaker_result*>(gpr_zalloc(sizeof(*result))); static_cast<alts_tsi_handshaker_result*>(gpr_zalloc(sizeof(*result)));
result->key_data = result->key_data =
@ -292,7 +290,7 @@ tsi_result alts_tsi_handshaker_result_create(grpc_gcp_HandshakerResp* resp,
grpc_gcp_AltsContext_set_application_protocol(context, application_protocol); grpc_gcp_AltsContext_set_application_protocol(context, application_protocol);
grpc_gcp_AltsContext_set_record_protocol(context, record_protocol); grpc_gcp_AltsContext_set_record_protocol(context, record_protocol);
// ALTS currently only supports the security level of 2, // ALTS currently only supports the security level of 2,
// which is "grpc_gcp_INTEGRITY_AND_PRIVACY" // which is "grpc_gcp_INTEGRITY_AND_PRIVACY".
grpc_gcp_AltsContext_set_security_level(context, 2); grpc_gcp_AltsContext_set_security_level(context, 2);
grpc_gcp_AltsContext_set_peer_service_account(context, peer_service_account); grpc_gcp_AltsContext_set_peer_service_account(context, peer_service_account);
grpc_gcp_AltsContext_set_local_service_account(context, grpc_gcp_AltsContext_set_local_service_account(context,

Loading…
Cancel
Save