summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTreehugger Robot <treehugger-gerrit@google.com>2021-12-29 21:01:05 +0100
committerAutomerger Merge Worker <android-build-automerger-merge-worker@system.gserviceaccount.com>2021-12-29 21:01:05 +0100
commitea0eb1758fbbb365b93b1e446c8692d16bb1fc88 (patch)
treeb4731c4ba1a9d56a20b414ac3364f94ad90702cb
parentMerge "Move package verifier from libinstall to libotautil" am: 86df64785a am: 31f842f1e6 am: 7c608afa47 am: 2c48bd472b (diff)
parentMerge "Fix wrong key indexes in package verification logs." am: 11563e2721 am: 6e88cc2db0 am: 2ac9924aa9 (diff)
downloadandroid_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar.gz
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar.bz2
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar.lz
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar.xz
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.tar.zst
android_bootable_recovery-ea0eb1758fbbb365b93b1e446c8692d16bb1fc88.zip
-rw-r--r--otautil/verifier.cpp5
1 files changed, 2 insertions, 3 deletions
diff --git a/otautil/verifier.cpp b/otautil/verifier.cpp
index 92b9faf29..8a65566ec 100644
--- a/otautil/verifier.cpp
+++ b/otautil/verifier.cpp
@@ -257,8 +257,8 @@ int verify_file(VerifierInterface* package, const std::vector<Certificate>& keys
// Check to make sure at least one of the keys matches the signature. Since any key can match,
// we need to try each before determining a verification failure has happened.
- size_t i = 0;
- for (const auto& key : keys) {
+ for (size_t i = 0; i < keys.size(); i++) {
+ const auto& key = keys[i];
const uint8_t* hash;
int hash_nid;
switch (key.hash_len) {
@@ -296,7 +296,6 @@ int verify_file(VerifierInterface* package, const std::vector<Certificate>& keys
} else {
LOG(INFO) << "Unknown key type " << key.key_type;
}
- i++;
}
if (need_sha1) {