Merge "Do Keymaster HMAC key agreement in vold." into pi-dev

am: a229dac0e7

Change-Id: I7fd1bc843ca31ca33e569e93047b1ce9e24e439c
This commit is contained in:
Shawn Willden 2018-05-11 09:45:32 -07:00 committed by android-build-merger
commit 9bc120416b
2 changed files with 7 additions and 0 deletions

View file

@ -96,8 +96,14 @@ bool KeymasterOperation::finish(std::string* output) {
return true;
}
/* static */ bool Keymaster::hmacKeyGenerated = false;
Keymaster::Keymaster() {
auto devices = KmDevice::enumerateAvailableDevices();
if (!hmacKeyGenerated) {
KmDevice::performHmacKeyAgreement(devices);
hmacKeyGenerated = true;
}
for (auto& dev : devices) {
// Explicitly avoid using STRONGBOX for now.
// TODO: Re-enable STRONGBOX, since it's what we really want. b/77338527

View file

@ -117,6 +117,7 @@ class Keymaster {
private:
std::unique_ptr<KmDevice> mDevice;
DISALLOW_COPY_AND_ASSIGN(Keymaster);
static bool hmacKeyGenerated;
};
} // namespace vold