Merge "Activate HMAC sharing check." into pi-dev
This commit is contained in:
commit
c2ac8a636e
1 changed files with 13 additions and 11 deletions
|
@ -156,17 +156,19 @@ static void computeHmac(const Keymaster::KeymasterSet& keymasters,
|
||||||
for (auto& keymaster : keymasters) {
|
for (auto& keymaster : keymasters) {
|
||||||
if (keymaster->halVersion().majorVersion < 4) continue;
|
if (keymaster->halVersion().majorVersion < 4) continue;
|
||||||
LOG(DEBUG) << "Computing HMAC for " << *keymaster;
|
LOG(DEBUG) << "Computing HMAC for " << *keymaster;
|
||||||
auto rc = keymaster->computeSharedHmac(params, [&](auto error, auto& curSharingCheck) {
|
auto rc = keymaster->computeSharedHmac(
|
||||||
CHECK(error == ErrorCode::OK)
|
params, [&](ErrorCode error, const hidl_vec<uint8_t>& curSharingCheck) {
|
||||||
<< "Failed to get HMAC parameters from " << *keymaster << " error " << error;
|
CHECK(error == ErrorCode::OK)
|
||||||
if (firstKeymaster) {
|
<< "Failed to get HMAC parameters from " << *keymaster << " error " << error;
|
||||||
sharingCheck = curSharingCheck;
|
if (firstKeymaster) {
|
||||||
firstKeymaster = false;
|
sharingCheck = curSharingCheck;
|
||||||
}
|
firstKeymaster = false;
|
||||||
// TODO: Validate that curSharingCheck == sharingCheck. b/77588764
|
}
|
||||||
// CHECK(curSharingCheck == sharingCheck) << "HMAC computation failed for " <<
|
CHECK(curSharingCheck == sharingCheck)
|
||||||
// *keymaster;
|
<< "HMAC computation failed for " << *keymaster //
|
||||||
});
|
<< " Expected: " << sharingCheck //
|
||||||
|
<< " got: " << curSharingCheck;
|
||||||
|
});
|
||||||
CHECK(rc.isOk()) << "Failed to communicate with " << *keymaster
|
CHECK(rc.isOk()) << "Failed to communicate with " << *keymaster
|
||||||
<< " error: " << rc.description();
|
<< " error: " << rc.description();
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue