From 122538c759bbbed9c606a35c11193436015db8fa Mon Sep 17 00:00:00 2001 From: Patrick McGrath Date: Thu, 9 May 2024 21:48:23 +0000 Subject: [PATCH] Add const qualification to clarify verifier is not modified --- cc/client/client.cc | 4 +--- cc/client/client.h | 2 +- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/cc/client/client.cc b/cc/client/client.cc index 8277c6d48a6..33ba3773d8c 100644 --- a/cc/client/client.cc +++ b/cc/client/client.cc @@ -37,7 +37,6 @@ namespace oak::client { -namespace { using ::oak::attestation::v1::AttestationResults; using ::oak::attestation::verification::AttestationVerifier; using ::oak::crypto::ClientEncryptor; @@ -46,13 +45,12 @@ using ::oak::crypto::v1::EncryptedRequest; using ::oak::crypto::v1::EncryptedResponse; using ::oak::session::v1::EndorsedEvidence; using ::oak::transport::TransportWrapper; -} // namespace constexpr absl::string_view kEmptyAssociatedData = ""; absl::StatusOr> OakClient::Create( std::unique_ptr transport, - AttestationVerifier& verifier) { + const AttestationVerifier& verifier) { absl::StatusOr endorsed_evidence = transport->GetEndorsedEvidence(); if (!endorsed_evidence.ok()) { diff --git a/cc/client/client.h b/cc/client/client.h index 8e92afe6c2a..93cfc6af258 100644 --- a/cc/client/client.h +++ b/cc/client/client.h @@ -39,7 +39,7 @@ class OakClient { // and creating an encrypted channel. static absl::StatusOr> Create( std::unique_ptr<::oak::transport::TransportWrapper> transport, - ::oak::attestation::verification::AttestationVerifier& verifier); + const ::oak::attestation::verification::AttestationVerifier& verifier); // Invoke the provided method by fetching and verifying the attested enclave // public key, and then using it to encrypt the request body.