Merge Android 12 QPR1

Bug: 210511427
Merged-In: Id6edfe90aadae4db1b23c5bc0de4981170ba42f2
Change-Id: Ic9e9149ae767b55c33b100586dfcb5790c862bbf
This commit is contained in:
Xin Li 2021-12-13 21:43:42 -08:00
commit 721a879cfe

View file

@ -377,9 +377,7 @@ static bool encryptWithKeystoreKey(Keystore& keystore, const std::string& dir,
const km::AuthorizationSet& keyParams, const KeyBuffer& message,
std::string* ciphertext) {
km::AuthorizationSet opParams =
km::AuthorizationSetBuilder()
.Authorization(km::TAG_ROLLBACK_RESISTANCE)
.Authorization(km::TAG_PURPOSE, km::KeyPurpose::ENCRYPT);
km::AuthorizationSetBuilder().Authorization(km::TAG_PURPOSE, km::KeyPurpose::ENCRYPT);
km::AuthorizationSet outParams;
auto opHandle = BeginKeystoreOp(keystore, dir, keyParams, opParams, &outParams);
if (!opHandle) return false;
@ -408,7 +406,6 @@ static bool decryptWithKeystoreKey(Keystore& keystore, const std::string& dir,
auto bodyAndMac = ciphertext.substr(GCM_NONCE_BYTES);
auto opParams = km::AuthorizationSetBuilder()
.Authorization(km::TAG_NONCE, nonce)
.Authorization(km::TAG_ROLLBACK_RESISTANCE)
.Authorization(km::TAG_PURPOSE, km::KeyPurpose::DECRYPT);
auto opHandle = BeginKeystoreOp(keystore, dir, keyParams, opParams, nullptr);
if (!opHandle) return false;