diff options
author | Android Build Coastguard Worker <android-build-coastguard-worker@google.com> | 2024-03-04 22:25:27 +0000 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2024-03-04 22:25:27 +0000 |
commit | 6f5813ae86461c6061151b3dbc1f7d4eb49ed015 (patch) | |
tree | 21eaeda9c02a938a1228b3b6fc1bada89b020e5c /keystore2 | |
parent | de78522ca686726c766d3499d12976fe7db442c7 (diff) | |
parent | 4e91a91f4ceb8f70e6dd4b1738277b42e5f855b6 (diff) | |
download | security-simpleperf-release.tar.gz |
Merge "Snap for 11526323 from a83982159f6e5bb3d5d123ab2fed0e3d9747b4bb to simpleperf-release" into simpleperf-releasesimpleperf-release
Diffstat (limited to 'keystore2')
-rw-r--r-- | keystore2/legacykeystore/lib.rs | 5 | ||||
-rw-r--r-- | keystore2/src/database.rs | 5 | ||||
-rw-r--r-- | keystore2/src/operation.rs | 2 | ||||
-rw-r--r-- | keystore2/src/security_level.rs | 5 |
4 files changed, 10 insertions, 7 deletions
diff --git a/keystore2/legacykeystore/lib.rs b/keystore2/legacykeystore/lib.rs index f7a81983..db3eff63 100644 --- a/keystore2/legacykeystore/lib.rs +++ b/keystore2/legacykeystore/lib.rs @@ -55,7 +55,7 @@ impl DB { F: Fn(&Transaction) -> Result<T>, { loop { - match self + let result = self .conn .transaction_with_behavior(behavior) .context("In with_transaction.") @@ -63,7 +63,8 @@ impl DB { .and_then(|(result, tx)| { tx.commit().context("In with_transaction: Failed to commit transaction.")?; Ok(result) - }) { + }); + match result { Ok(result) => break Ok(result), Err(e) => { if Self::is_locked_error(&e) { diff --git a/keystore2/src/database.rs b/keystore2/src/database.rs index b526daac..2757313f 100644 --- a/keystore2/src/database.rs +++ b/keystore2/src/database.rs @@ -1467,7 +1467,7 @@ impl KeystoreDB { F: Fn(&Transaction) -> Result<(bool, T)>, { loop { - match self + let result = self .conn .transaction_with_behavior(behavior) .context(ks_err!()) @@ -1475,7 +1475,8 @@ impl KeystoreDB { .and_then(|(result, tx)| { tx.commit().context(ks_err!("Failed to commit transaction."))?; Ok(result) - }) { + }); + match result { Ok(result) => break Ok(result), Err(e) => { if Self::is_locked_error(&e) { diff --git a/keystore2/src/operation.rs b/keystore2/src/operation.rs index eabc1abb..11eaf17a 100644 --- a/keystore2/src/operation.rs +++ b/keystore2/src/operation.rs @@ -290,7 +290,7 @@ impl Operation { // We abort the operation. If there was an error we log it but ignore it. if let Err(e) = map_km_error(self.km_op.abort()) { - log::error!("In prune: KeyMint::abort failed with {:?}.", e); + log::warn!("In prune: KeyMint::abort failed with {:?}.", e); } Ok(()) diff --git a/keystore2/src/security_level.rs b/keystore2/src/security_level.rs index 6fb0eb20..5f9745f0 100644 --- a/keystore2/src/security_level.rs +++ b/keystore2/src/security_level.rs @@ -927,7 +927,7 @@ impl KeystoreSecurityLevel { .context(ks_err!("Check permission"))?; let km_dev = &self.keymint; - match { + let res = { let _wp = self.watch_millis( concat!( "In IKeystoreSecurityLevel::convert_storage_key_to_ephemeral: ", @@ -936,7 +936,8 @@ impl KeystoreSecurityLevel { 500, ); map_km_error(km_dev.convertStorageKeyToEphemeral(key_blob)) - } { + }; + match res { Ok(result) => { Ok(EphemeralStorageKeyResponse { ephemeralKey: result, upgradedBlob: None }) } |