Stop copying macFunction in RPK utilities
We were copying the macFunction, but we really only needed a reference.
This is just a bit of clean up to quiet some compiler warnings.
Test: VtsHalRemotelyProvisionedComponentTargetTest
Change-Id: I948faff6a97af854b0333ff1a2909667a57afdea
diff --git a/android_keymaster/remote_provisioning_utils.cpp b/android_keymaster/remote_provisioning_utils.cpp
index 8cb635b..78a058a 100644
--- a/android_keymaster/remote_provisioning_utils.cpp
+++ b/android_keymaster/remote_provisioning_utils.cpp
@@ -126,7 +126,7 @@
StatusOr<std::vector<uint8_t> /* pubkeys */>
validateAndExtractPubkeys(bool testMode, uint32_t numKeys, KeymasterBlob* keysToSign,
- cppcose::HmacSha256Function macFunction) {
+ const cppcose::HmacSha256Function& macFunction) {
auto pubKeysToMac = cppbor::Array();
for (size_t i = 0; i < numKeys; i++) {
auto [macedKeyItem, _, coseMacErrMsg] =
diff --git a/include/keymaster/remote_provisioning_utils.h b/include/keymaster/remote_provisioning_utils.h
index 7c38a76..76acdc7 100644
--- a/include/keymaster/remote_provisioning_utils.h
+++ b/include/keymaster/remote_provisioning_utils.h
@@ -70,7 +70,7 @@
StatusOr<std::vector<uint8_t> /* pubkeys */>
validateAndExtractPubkeys(bool testMode, uint32_t numKeys, KeymasterBlob* keysToSign,
- cppcose::HmacSha256Function macFunction);
+ const cppcose::HmacSha256Function& macFunction);
cppbor::Array buildCertReqRecipients(const std::vector<uint8_t>& pubkey,
const std::vector<uint8_t>& kid);