Merge "Merge Android 12 QPR1"

This commit is contained in:
Xin Li 2021-12-14 20:25:23 +00:00 committed by Gerrit Code Review
commit 235d1d65f8

View file

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