summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJacky Liu <qsliu@google.com>2021-12-29 05:09:06 +0100
committerJacky Liu <qsliu@google.com>2021-12-29 05:51:40 +0100
commit5ffad4b00b2312d4ccd234e59953e570a83a7979 (patch)
treea1402284b7822169d31a81672d7361a5d057b24d
parentMerge "Move package verifier from libinstall to libotautil" (diff)
downloadandroid_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar.gz
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar.bz2
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar.lz
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar.xz
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.tar.zst
android_bootable_recovery-5ffad4b00b2312d4ccd234e59953e570a83a7979.zip
Diffstat (limited to '')
-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) {