diff options
author | Kelvin Zhang <zhangkelvin@google.com> | 2022-05-25 23:04:45 +0200 |
---|---|---|
committer | Kelvin Zhang <zhangkelvin@google.com> | 2022-05-25 23:05:48 +0200 |
commit | 063bc245642b52e1064d29f233f46ad8db0a9a17 (patch) | |
tree | c7e936bd0c97ea8f5d6ffb2fd4c8068e104b759c /otautil | |
parent | Merge "Log a copy of recovery log to kernel logs" (diff) | |
download | android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar.gz android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar.bz2 android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar.lz android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar.xz android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.tar.zst android_bootable_recovery-063bc245642b52e1064d29f233f46ad8db0a9a17.zip |
Diffstat (limited to 'otautil')
-rw-r--r-- | otautil/verifier.cpp | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/otautil/verifier.cpp b/otautil/verifier.cpp index 8a65566ec..83ad7082b 100644 --- a/otautil/verifier.cpp +++ b/otautil/verifier.cpp @@ -309,13 +309,15 @@ int verify_file(VerifierInterface* package, const std::vector<Certificate>& keys } static std::vector<Certificate> IterateZipEntriesAndSearchForKeys(const ZipArchiveHandle& handle) { - void* cookie; + void* cookie{}; + int32_t iter_status = StartIteration(handle, &cookie, "", "x509.pem"); if (iter_status != 0) { LOG(ERROR) << "Failed to iterate over entries in the certificate zipfile: " << ErrorCodeString(iter_status); return {}; } + std::unique_ptr<void, decltype(&EndIteration)> cookie_guard(cookie, &EndIteration); std::vector<Certificate> result; |