summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-03 18:17:16 +0000
committerAndroid Build Coastguard Worker <android-build-coastguard-worker@google.com>2022-06-03 18:17:16 +0000
commit9584f1e18e1a1f47d296e297308ffdec4e874145 (patch)
tree9194ea173d28ec1e64a3791bb6b5351c8664eccf
parent9b277ecfee8d95d72487147c5a8482202254be09 (diff)
parentd337c7727196f42af70aa93ab84f7c8b48cd9486 (diff)
downloadsecurity-9584f1e18e1a1f47d296e297308ffdec4e874145.tar.gz
Snap for 8680285 from d337c7727196f42af70aa93ab84f7c8b48cd9486 to mainline-go-scheduling-release
Change-Id: I495224f485a5357f84bdd3f586cf47ea41868a57
-rw-r--r--keystore2/src/database.rs16
-rw-r--r--ondevice-signing/odsign_main.cpp6
2 files changed, 13 insertions, 9 deletions
diff --git a/keystore2/src/database.rs b/keystore2/src/database.rs
index 6b74e3c8..a3979bd5 100644
--- a/keystore2/src/database.rs
+++ b/keystore2/src/database.rs
@@ -2893,33 +2893,33 @@ impl KeystoreDB {
"DELETE FROM persistent.keymetadata
WHERE keyentryid IN (
SELECT id FROM persistent.keyentry
- WHERE domain = ? AND namespace = ? AND key_type = ?
+ WHERE domain = ? AND namespace = ? AND (key_type = ? OR key_type = ?)
);",
- params![domain.0, namespace, KeyType::Client],
+ params![domain.0, namespace, KeyType::Client, KeyType::Attestation],
)
.context("Trying to delete keymetadata.")?;
tx.execute(
"DELETE FROM persistent.keyparameter
WHERE keyentryid IN (
SELECT id FROM persistent.keyentry
- WHERE domain = ? AND namespace = ? AND key_type = ?
+ WHERE domain = ? AND namespace = ? AND (key_type = ? OR key_type = ?)
);",
- params![domain.0, namespace, KeyType::Client],
+ params![domain.0, namespace, KeyType::Client, KeyType::Attestation],
)
.context("Trying to delete keyparameters.")?;
tx.execute(
"DELETE FROM persistent.grant
WHERE keyentryid IN (
SELECT id FROM persistent.keyentry
- WHERE domain = ? AND namespace = ? AND key_type = ?
+ WHERE domain = ? AND namespace = ? AND (key_type = ? OR key_type = ?)
);",
- params![domain.0, namespace, KeyType::Client],
+ params![domain.0, namespace, KeyType::Client, KeyType::Attestation],
)
.context("Trying to delete grants.")?;
tx.execute(
"DELETE FROM persistent.keyentry
- WHERE domain = ? AND namespace = ? AND key_type = ?;",
- params![domain.0, namespace, KeyType::Client],
+ WHERE domain = ? AND namespace = ? AND (key_type = ? OR key_type = ?);",
+ params![domain.0, namespace, KeyType::Client, KeyType::Attestation],
)
.context("Trying to delete keyentry.")?;
Ok(()).need_gc()
diff --git a/ondevice-signing/odsign_main.cpp b/ondevice-signing/odsign_main.cpp
index 04679a59..c45e3085 100644
--- a/ondevice-signing/odsign_main.cpp
+++ b/ondevice-signing/odsign_main.cpp
@@ -374,7 +374,11 @@ art::odrefresh::ExitCode CheckCompOsPendingArtifacts(const SigningKey& signing_k
if (!directoryHasContent(kCompOsPendingArtifactsDir)) {
// No pending CompOS artifacts, all that matters is the current ones.
- return checkArtifacts();
+ art::odrefresh::ExitCode odrefresh_status = checkArtifacts();
+ if (odrefresh_status == art::odrefresh::ExitCode::kOkay) {
+ compos_check_record->current_artifacts_ok = true;
+ }
+ return odrefresh_status;
}
compos_check_record->comp_os_pending_artifacts_exists = true;