diff options
author | Tao Bao <tbao@google.com> | 2017-03-18 15:16:14 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2017-03-18 15:16:16 +0100 |
commit | 90d3f20c993671ec7fa90119ce5d214cc370f83d (patch) | |
tree | bbc97b3f9d49d4c05260677a2d4f9ffb561684cb /verifier.h | |
parent | Merge "Revert "Revert "Print SHA-1 in hex for corrupted blocks""" (diff) | |
parent | Drop the dependency on 'ui' in verify_file(). (diff) | |
download | android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar.gz android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar.bz2 android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar.lz android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar.xz android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.tar.zst android_bootable_recovery-90d3f20c993671ec7fa90119ce5d214cc370f83d.zip |
Diffstat (limited to '')
-rw-r--r-- | verifier.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/verifier.h b/verifier.h index 58083fe14..067dab554 100644 --- a/verifier.h +++ b/verifier.h @@ -17,6 +17,7 @@ #ifndef _RECOVERY_VERIFIER_H #define _RECOVERY_VERIFIER_H +#include <functional> #include <memory> #include <vector> @@ -58,13 +59,14 @@ struct Certificate { std::unique_ptr<EC_KEY, ECKEYDeleter> ec; }; -/* addr and length define a an update package file that has been - * loaded (or mmap'ed, or whatever) into memory. Verify that the file - * is signed and the signature matches one of the given keys. Return - * one of the constants below. +/* + * 'addr' and 'length' define an update package file that has been loaded (or mmap'ed, or + * whatever) into memory. Verifies that the file is signed and the signature matches one of the + * given keys. It optionally accepts a callback function for posting the progress to. Returns one + * of the constants of VERIFY_SUCCESS and VERIFY_FAILURE. */ -int verify_file(unsigned char* addr, size_t length, - const std::vector<Certificate>& keys); +int verify_file(unsigned char* addr, size_t length, const std::vector<Certificate>& keys, + const std::function<void(float)>& set_progress = nullptr); bool load_keys(const char* filename, std::vector<Certificate>& certs); |