xref: /aosp_15_r20/system/security/ondevice-signing/KeystoreHmacKey.cpp (revision e1997b9af69e3155ead6e072d106a0077849ffba)
1*e1997b9aSAndroid Build Coastguard Worker /*
2*e1997b9aSAndroid Build Coastguard Worker  * Copyright (C) 2021 The Android Open Source Project
3*e1997b9aSAndroid Build Coastguard Worker  *
4*e1997b9aSAndroid Build Coastguard Worker  * Licensed under the Apache License, Version 2.0 (the "License");
5*e1997b9aSAndroid Build Coastguard Worker  * you may not use this file except in compliance with the License.
6*e1997b9aSAndroid Build Coastguard Worker  * You may obtain a copy of the License at
7*e1997b9aSAndroid Build Coastguard Worker  *
8*e1997b9aSAndroid Build Coastguard Worker  *      http://www.apache.org/licenses/LICENSE-2.0
9*e1997b9aSAndroid Build Coastguard Worker  *
10*e1997b9aSAndroid Build Coastguard Worker  * Unless required by applicable law or agreed to in writing, software
11*e1997b9aSAndroid Build Coastguard Worker  * distributed under the License is distributed on an "AS IS" BASIS,
12*e1997b9aSAndroid Build Coastguard Worker  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13*e1997b9aSAndroid Build Coastguard Worker  * See the License for the specific language governing permissions and
14*e1997b9aSAndroid Build Coastguard Worker  * limitations under the License.
15*e1997b9aSAndroid Build Coastguard Worker  */
16*e1997b9aSAndroid Build Coastguard Worker 
17*e1997b9aSAndroid Build Coastguard Worker #include <string>
18*e1997b9aSAndroid Build Coastguard Worker 
19*e1997b9aSAndroid Build Coastguard Worker #include <android-base/file.h>
20*e1997b9aSAndroid Build Coastguard Worker #include <android-base/logging.h>
21*e1997b9aSAndroid Build Coastguard Worker #include <binder/IServiceManager.h>
22*e1997b9aSAndroid Build Coastguard Worker 
23*e1997b9aSAndroid Build Coastguard Worker #include <fcntl.h>
24*e1997b9aSAndroid Build Coastguard Worker #include <sys/stat.h>
25*e1997b9aSAndroid Build Coastguard Worker #include <sys/types.h>
26*e1997b9aSAndroid Build Coastguard Worker 
27*e1997b9aSAndroid Build Coastguard Worker #include "CertUtils.h"
28*e1997b9aSAndroid Build Coastguard Worker #include "KeyConstants.h"
29*e1997b9aSAndroid Build Coastguard Worker #include "KeystoreHmacKey.h"
30*e1997b9aSAndroid Build Coastguard Worker 
31*e1997b9aSAndroid Build Coastguard Worker using android::sp;
32*e1997b9aSAndroid Build Coastguard Worker using android::String16;
33*e1997b9aSAndroid Build Coastguard Worker 
34*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::Algorithm;
35*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::Digest;
36*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::KeyParameter;
37*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::KeyParameterValue;
38*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::KeyPurpose;
39*e1997b9aSAndroid Build Coastguard Worker using android::hardware::security::keymint::Tag;
40*e1997b9aSAndroid Build Coastguard Worker 
41*e1997b9aSAndroid Build Coastguard Worker using android::system::keystore2::CreateOperationResponse;
42*e1997b9aSAndroid Build Coastguard Worker using android::system::keystore2::Domain;
43*e1997b9aSAndroid Build Coastguard Worker using android::system::keystore2::KeyDescriptor;
44*e1997b9aSAndroid Build Coastguard Worker using android::system::keystore2::KeyEntryResponse;
45*e1997b9aSAndroid Build Coastguard Worker using android::system::keystore2::KeyMetadata;
46*e1997b9aSAndroid Build Coastguard Worker 
47*e1997b9aSAndroid Build Coastguard Worker using android::base::Error;
48*e1997b9aSAndroid Build Coastguard Worker using android::base::Result;
49*e1997b9aSAndroid Build Coastguard Worker 
50*e1997b9aSAndroid Build Coastguard Worker using android::base::unique_fd;
51*e1997b9aSAndroid Build Coastguard Worker 
getHmacKeyDescriptor(const android::String16 & keyAlias,int64_t keyNspace)52*e1997b9aSAndroid Build Coastguard Worker static KeyDescriptor getHmacKeyDescriptor(const android::String16& keyAlias, int64_t keyNspace) {
53*e1997b9aSAndroid Build Coastguard Worker     // AIDL parcelable objects don't have constructor
54*e1997b9aSAndroid Build Coastguard Worker     static KeyDescriptor descriptor;
55*e1997b9aSAndroid Build Coastguard Worker     static std::once_flag flag;
56*e1997b9aSAndroid Build Coastguard Worker     std::call_once(flag, [&]() {
57*e1997b9aSAndroid Build Coastguard Worker         descriptor.domain = Domain::SELINUX;
58*e1997b9aSAndroid Build Coastguard Worker         descriptor.alias = keyAlias + android::String16("-hmac");
59*e1997b9aSAndroid Build Coastguard Worker         descriptor.nspace = keyNspace;
60*e1997b9aSAndroid Build Coastguard Worker     });
61*e1997b9aSAndroid Build Coastguard Worker 
62*e1997b9aSAndroid Build Coastguard Worker     return descriptor;
63*e1997b9aSAndroid Build Coastguard Worker }
64*e1997b9aSAndroid Build Coastguard Worker 
createKey()65*e1997b9aSAndroid Build Coastguard Worker Result<void> KeystoreHmacKey::createKey() {
66*e1997b9aSAndroid Build Coastguard Worker     std::vector<KeyParameter> params;
67*e1997b9aSAndroid Build Coastguard Worker 
68*e1997b9aSAndroid Build Coastguard Worker     KeyParameter algo;
69*e1997b9aSAndroid Build Coastguard Worker     algo.tag = Tag::ALGORITHM;
70*e1997b9aSAndroid Build Coastguard Worker     algo.value = KeyParameterValue::make<KeyParameterValue::algorithm>(Algorithm::HMAC);
71*e1997b9aSAndroid Build Coastguard Worker     params.push_back(algo);
72*e1997b9aSAndroid Build Coastguard Worker 
73*e1997b9aSAndroid Build Coastguard Worker     KeyParameter key_size;
74*e1997b9aSAndroid Build Coastguard Worker     key_size.tag = Tag::KEY_SIZE;
75*e1997b9aSAndroid Build Coastguard Worker     key_size.value = KeyParameterValue::make<KeyParameterValue::integer>(kHmacKeySize);
76*e1997b9aSAndroid Build Coastguard Worker     params.push_back(key_size);
77*e1997b9aSAndroid Build Coastguard Worker 
78*e1997b9aSAndroid Build Coastguard Worker     KeyParameter min_mac_length;
79*e1997b9aSAndroid Build Coastguard Worker     min_mac_length.tag = Tag::MIN_MAC_LENGTH;
80*e1997b9aSAndroid Build Coastguard Worker     min_mac_length.value = KeyParameterValue::make<KeyParameterValue::integer>(256);
81*e1997b9aSAndroid Build Coastguard Worker     params.push_back(min_mac_length);
82*e1997b9aSAndroid Build Coastguard Worker 
83*e1997b9aSAndroid Build Coastguard Worker     KeyParameter digest;
84*e1997b9aSAndroid Build Coastguard Worker     digest.tag = Tag::DIGEST;
85*e1997b9aSAndroid Build Coastguard Worker     digest.value = KeyParameterValue::make<KeyParameterValue::digest>(Digest::SHA_2_256);
86*e1997b9aSAndroid Build Coastguard Worker     params.push_back(digest);
87*e1997b9aSAndroid Build Coastguard Worker 
88*e1997b9aSAndroid Build Coastguard Worker     KeyParameter purposeSign;
89*e1997b9aSAndroid Build Coastguard Worker     purposeSign.tag = Tag::PURPOSE;
90*e1997b9aSAndroid Build Coastguard Worker     purposeSign.value = KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::SIGN);
91*e1997b9aSAndroid Build Coastguard Worker     params.push_back(purposeSign);
92*e1997b9aSAndroid Build Coastguard Worker 
93*e1997b9aSAndroid Build Coastguard Worker     KeyParameter purposeVerify;
94*e1997b9aSAndroid Build Coastguard Worker     purposeVerify.tag = Tag::PURPOSE;
95*e1997b9aSAndroid Build Coastguard Worker     purposeVerify.value =
96*e1997b9aSAndroid Build Coastguard Worker         KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::VERIFY);
97*e1997b9aSAndroid Build Coastguard Worker     params.push_back(purposeVerify);
98*e1997b9aSAndroid Build Coastguard Worker 
99*e1997b9aSAndroid Build Coastguard Worker     KeyParameter auth;
100*e1997b9aSAndroid Build Coastguard Worker     auth.tag = Tag::NO_AUTH_REQUIRED;
101*e1997b9aSAndroid Build Coastguard Worker     auth.value = KeyParameterValue::make<KeyParameterValue::boolValue>(true);
102*e1997b9aSAndroid Build Coastguard Worker     params.push_back(auth);
103*e1997b9aSAndroid Build Coastguard Worker 
104*e1997b9aSAndroid Build Coastguard Worker     KeyParameter boot_level;
105*e1997b9aSAndroid Build Coastguard Worker     boot_level.tag = Tag::MAX_BOOT_LEVEL;
106*e1997b9aSAndroid Build Coastguard Worker     boot_level.value = KeyParameterValue::make<KeyParameterValue::integer>(mKeyBootLevel);
107*e1997b9aSAndroid Build Coastguard Worker     params.push_back(boot_level);
108*e1997b9aSAndroid Build Coastguard Worker 
109*e1997b9aSAndroid Build Coastguard Worker     KeyMetadata metadata;
110*e1997b9aSAndroid Build Coastguard Worker     auto status = mSecurityLevel->generateKey(mDescriptor, {}, params, 0, {}, &metadata);
111*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
112*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to create new HMAC key: " << status;
113*e1997b9aSAndroid Build Coastguard Worker     }
114*e1997b9aSAndroid Build Coastguard Worker 
115*e1997b9aSAndroid Build Coastguard Worker     return {};
116*e1997b9aSAndroid Build Coastguard Worker }
117*e1997b9aSAndroid Build Coastguard Worker 
initialize(sp<IKeystoreService> service,sp<IKeystoreSecurityLevel> securityLevel)118*e1997b9aSAndroid Build Coastguard Worker Result<void> KeystoreHmacKey::initialize(sp<IKeystoreService> service,
119*e1997b9aSAndroid Build Coastguard Worker                                          sp<IKeystoreSecurityLevel> securityLevel) {
120*e1997b9aSAndroid Build Coastguard Worker     mService = std::move(service);
121*e1997b9aSAndroid Build Coastguard Worker     mSecurityLevel = std::move(securityLevel);
122*e1997b9aSAndroid Build Coastguard Worker 
123*e1997b9aSAndroid Build Coastguard Worker     // See if we can fetch an existing key
124*e1997b9aSAndroid Build Coastguard Worker     KeyEntryResponse keyEntryResponse;
125*e1997b9aSAndroid Build Coastguard Worker     LOG(INFO) << "Trying to retrieve existing HMAC key...";
126*e1997b9aSAndroid Build Coastguard Worker     auto status = mService->getKeyEntry(mDescriptor, &keyEntryResponse);
127*e1997b9aSAndroid Build Coastguard Worker     bool keyValid = false;
128*e1997b9aSAndroid Build Coastguard Worker 
129*e1997b9aSAndroid Build Coastguard Worker     if (status.isOk()) {
130*e1997b9aSAndroid Build Coastguard Worker         // Make sure this is an early boot key
131*e1997b9aSAndroid Build Coastguard Worker         for (const auto& auth : keyEntryResponse.metadata.authorizations) {
132*e1997b9aSAndroid Build Coastguard Worker             if (auth.keyParameter.tag == Tag::MAX_BOOT_LEVEL) {
133*e1997b9aSAndroid Build Coastguard Worker                 if (auth.keyParameter.value.get<KeyParameterValue::integer>() == mKeyBootLevel) {
134*e1997b9aSAndroid Build Coastguard Worker                     keyValid = true;
135*e1997b9aSAndroid Build Coastguard Worker                     break;
136*e1997b9aSAndroid Build Coastguard Worker                 }
137*e1997b9aSAndroid Build Coastguard Worker             }
138*e1997b9aSAndroid Build Coastguard Worker         }
139*e1997b9aSAndroid Build Coastguard Worker         if (!keyValid) {
140*e1997b9aSAndroid Build Coastguard Worker             LOG(WARNING) << "Found invalid HMAC key without MAX_BOOT_LEVEL tag";
141*e1997b9aSAndroid Build Coastguard Worker         }
142*e1997b9aSAndroid Build Coastguard Worker     }
143*e1997b9aSAndroid Build Coastguard Worker 
144*e1997b9aSAndroid Build Coastguard Worker     if (!keyValid) {
145*e1997b9aSAndroid Build Coastguard Worker         LOG(INFO) << "Existing HMAC key not found or invalid, creating new key";
146*e1997b9aSAndroid Build Coastguard Worker         return createKey();
147*e1997b9aSAndroid Build Coastguard Worker     } else {
148*e1997b9aSAndroid Build Coastguard Worker         return {};
149*e1997b9aSAndroid Build Coastguard Worker     }
150*e1997b9aSAndroid Build Coastguard Worker }
151*e1997b9aSAndroid Build Coastguard Worker 
KeystoreHmacKey(const android::String16 & keyAlias,int64_t keyNspace,int keyBootLevel)152*e1997b9aSAndroid Build Coastguard Worker KeystoreHmacKey::KeystoreHmacKey(const android::String16& keyAlias, int64_t keyNspace,
153*e1997b9aSAndroid Build Coastguard Worker                                  int keyBootLevel)
154*e1997b9aSAndroid Build Coastguard Worker     : mDescriptor(getHmacKeyDescriptor(keyAlias, keyNspace)), mKeyBootLevel(keyBootLevel) {}
155*e1997b9aSAndroid Build Coastguard Worker 
getVerifyOpParameters()156*e1997b9aSAndroid Build Coastguard Worker static std::vector<KeyParameter> getVerifyOpParameters() {
157*e1997b9aSAndroid Build Coastguard Worker     std::vector<KeyParameter> opParameters;
158*e1997b9aSAndroid Build Coastguard Worker 
159*e1997b9aSAndroid Build Coastguard Worker     KeyParameter algo;
160*e1997b9aSAndroid Build Coastguard Worker     algo.tag = Tag::ALGORITHM;
161*e1997b9aSAndroid Build Coastguard Worker     algo.value = KeyParameterValue::make<KeyParameterValue::algorithm>(Algorithm::HMAC);
162*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(algo);
163*e1997b9aSAndroid Build Coastguard Worker 
164*e1997b9aSAndroid Build Coastguard Worker     KeyParameter digest;
165*e1997b9aSAndroid Build Coastguard Worker     digest.tag = Tag::DIGEST;
166*e1997b9aSAndroid Build Coastguard Worker     digest.value = KeyParameterValue::make<KeyParameterValue::digest>(Digest::SHA_2_256);
167*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(digest);
168*e1997b9aSAndroid Build Coastguard Worker 
169*e1997b9aSAndroid Build Coastguard Worker     KeyParameter purpose;
170*e1997b9aSAndroid Build Coastguard Worker     purpose.tag = Tag::PURPOSE;
171*e1997b9aSAndroid Build Coastguard Worker     purpose.value = KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::VERIFY);
172*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(purpose);
173*e1997b9aSAndroid Build Coastguard Worker 
174*e1997b9aSAndroid Build Coastguard Worker     return opParameters;
175*e1997b9aSAndroid Build Coastguard Worker }
176*e1997b9aSAndroid Build Coastguard Worker 
getSignOpParameters()177*e1997b9aSAndroid Build Coastguard Worker static std::vector<KeyParameter> getSignOpParameters() {
178*e1997b9aSAndroid Build Coastguard Worker     std::vector<KeyParameter> opParameters;
179*e1997b9aSAndroid Build Coastguard Worker 
180*e1997b9aSAndroid Build Coastguard Worker     KeyParameter algo;
181*e1997b9aSAndroid Build Coastguard Worker     algo.tag = Tag::ALGORITHM;
182*e1997b9aSAndroid Build Coastguard Worker     algo.value = KeyParameterValue::make<KeyParameterValue::algorithm>(Algorithm::HMAC);
183*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(algo);
184*e1997b9aSAndroid Build Coastguard Worker 
185*e1997b9aSAndroid Build Coastguard Worker     KeyParameter mac_length;
186*e1997b9aSAndroid Build Coastguard Worker     mac_length.tag = Tag::MAC_LENGTH;
187*e1997b9aSAndroid Build Coastguard Worker     mac_length.value = KeyParameterValue::make<KeyParameterValue::integer>(256);
188*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(mac_length);
189*e1997b9aSAndroid Build Coastguard Worker 
190*e1997b9aSAndroid Build Coastguard Worker     KeyParameter digest;
191*e1997b9aSAndroid Build Coastguard Worker     digest.tag = Tag::DIGEST;
192*e1997b9aSAndroid Build Coastguard Worker     digest.value = KeyParameterValue::make<KeyParameterValue::digest>(Digest::SHA_2_256);
193*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(digest);
194*e1997b9aSAndroid Build Coastguard Worker 
195*e1997b9aSAndroid Build Coastguard Worker     KeyParameter purpose;
196*e1997b9aSAndroid Build Coastguard Worker     purpose.tag = Tag::PURPOSE;
197*e1997b9aSAndroid Build Coastguard Worker     purpose.value = KeyParameterValue::make<KeyParameterValue::keyPurpose>(KeyPurpose::SIGN);
198*e1997b9aSAndroid Build Coastguard Worker     opParameters.push_back(purpose);
199*e1997b9aSAndroid Build Coastguard Worker 
200*e1997b9aSAndroid Build Coastguard Worker     return opParameters;
201*e1997b9aSAndroid Build Coastguard Worker }
202*e1997b9aSAndroid Build Coastguard Worker 
sign(const std::string & message) const203*e1997b9aSAndroid Build Coastguard Worker Result<std::string> KeystoreHmacKey::sign(const std::string& message) const {
204*e1997b9aSAndroid Build Coastguard Worker     CreateOperationResponse opResponse;
205*e1997b9aSAndroid Build Coastguard Worker     static auto params = getSignOpParameters();
206*e1997b9aSAndroid Build Coastguard Worker 
207*e1997b9aSAndroid Build Coastguard Worker     auto status = mSecurityLevel->createOperation(mDescriptor, params, false, &opResponse);
208*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
209*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to create keystore signing operation: " << status;
210*e1997b9aSAndroid Build Coastguard Worker     }
211*e1997b9aSAndroid Build Coastguard Worker     auto operation = opResponse.iOperation;
212*e1997b9aSAndroid Build Coastguard Worker 
213*e1997b9aSAndroid Build Coastguard Worker     std::optional<std::vector<uint8_t>> out;
214*e1997b9aSAndroid Build Coastguard Worker     status = operation->update({message.begin(), message.end()}, &out);
215*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
216*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to call keystore update operation.";
217*e1997b9aSAndroid Build Coastguard Worker     }
218*e1997b9aSAndroid Build Coastguard Worker 
219*e1997b9aSAndroid Build Coastguard Worker     std::optional<std::vector<uint8_t>> signature;
220*e1997b9aSAndroid Build Coastguard Worker     status = operation->finish({}, {}, &signature);
221*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
222*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to call keystore finish operation.";
223*e1997b9aSAndroid Build Coastguard Worker     }
224*e1997b9aSAndroid Build Coastguard Worker 
225*e1997b9aSAndroid Build Coastguard Worker     if (!signature.has_value()) {
226*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Didn't receive a signature from keystore finish operation.";
227*e1997b9aSAndroid Build Coastguard Worker     }
228*e1997b9aSAndroid Build Coastguard Worker 
229*e1997b9aSAndroid Build Coastguard Worker     return std::string{signature.value().begin(), signature.value().end()};
230*e1997b9aSAndroid Build Coastguard Worker }
231*e1997b9aSAndroid Build Coastguard Worker 
verify(const std::string & message,const std::string & signature) const232*e1997b9aSAndroid Build Coastguard Worker Result<void> KeystoreHmacKey::verify(const std::string& message,
233*e1997b9aSAndroid Build Coastguard Worker                                      const std::string& signature) const {
234*e1997b9aSAndroid Build Coastguard Worker     CreateOperationResponse opResponse;
235*e1997b9aSAndroid Build Coastguard Worker     static auto params = getVerifyOpParameters();
236*e1997b9aSAndroid Build Coastguard Worker 
237*e1997b9aSAndroid Build Coastguard Worker     auto status = mSecurityLevel->createOperation(mDescriptor, params, false, &opResponse);
238*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
239*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to create keystore verification operation: " << status;
240*e1997b9aSAndroid Build Coastguard Worker     }
241*e1997b9aSAndroid Build Coastguard Worker     auto operation = opResponse.iOperation;
242*e1997b9aSAndroid Build Coastguard Worker 
243*e1997b9aSAndroid Build Coastguard Worker     std::optional<std::vector<uint8_t>> out;
244*e1997b9aSAndroid Build Coastguard Worker     status = operation->update({message.begin(), message.end()}, &out);
245*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
246*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to call keystore update operation.";
247*e1997b9aSAndroid Build Coastguard Worker     }
248*e1997b9aSAndroid Build Coastguard Worker 
249*e1997b9aSAndroid Build Coastguard Worker     std::optional<std::vector<uint8_t>> out_signature;
250*e1997b9aSAndroid Build Coastguard Worker     std::vector<uint8_t> in_signature{signature.begin(), signature.end()};
251*e1997b9aSAndroid Build Coastguard Worker     status = operation->finish({}, in_signature, &out_signature);
252*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
253*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to call keystore finish operation.";
254*e1997b9aSAndroid Build Coastguard Worker     }
255*e1997b9aSAndroid Build Coastguard Worker 
256*e1997b9aSAndroid Build Coastguard Worker     return {};
257*e1997b9aSAndroid Build Coastguard Worker }
258*e1997b9aSAndroid Build Coastguard Worker 
deleteKey() const259*e1997b9aSAndroid Build Coastguard Worker Result<void> KeystoreHmacKey::deleteKey() const {
260*e1997b9aSAndroid Build Coastguard Worker     auto status = mService->deleteKey(mDescriptor);
261*e1997b9aSAndroid Build Coastguard Worker     if (!status.isOk()) {
262*e1997b9aSAndroid Build Coastguard Worker         return Error() << "Failed to delete HMAC key: " << status;
263*e1997b9aSAndroid Build Coastguard Worker     }
264*e1997b9aSAndroid Build Coastguard Worker 
265*e1997b9aSAndroid Build Coastguard Worker     return {};
266*e1997b9aSAndroid Build Coastguard Worker }
267