Skip to content

Commit

Permalink
Fix usage of absl::string_view in go/oak-cr/15661
Browse files Browse the repository at this point in the history
absl::string_view::data() returns data that is not necessarily
null-terminated. So we need to explicitly provide the size as well.

Change-Id: I827ade8251be96301512331af0f309242f1b5b85
  • Loading branch information
jblebrun committed Jan 30, 2025
1 parent 5440c2f commit 006452f
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions cc/containers/sdk/orchestrator_crypto_client.cc
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ absl::StatusOr<SessionKeys> OrchestratorCryptoClient::DeriveSessionKeys(
DeriveSessionKeysRequest request;
request.set_key_origin(key_origin);
request.set_serialized_encapsulated_public_key(
serialized_encapsulated_public_key.data());
serialized_encapsulated_public_key.data(),
serialized_encapsulated_public_key.size());
DeriveSessionKeysResponse response;

grpc::Status status = stub_->DeriveSessionKeys(&context, request, &response);
Expand All @@ -69,7 +70,7 @@ absl::StatusOr<Signature> OrchestratorCryptoClient::Sign(
context.set_authority(kContextAuthority);
SignRequest request;
request.set_key_origin(key_origin);
request.set_message(message.data());
request.set_message(message.data(), message.size());
SignResponse response;

grpc::Status status = stub_->Sign(&context, request, &response);
Expand Down

0 comments on commit 006452f

Please sign in to comment.