summaryrefslogtreecommitdiffstats
path: root/verifier.h
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2017-03-17 01:37:38 +0100
committerTao Bao <tbao@google.com>2017-03-17 22:14:07 +0100
commit7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2 (patch)
tree50e5c63d245b942bca1efac8e96600a456e73d2d /verifier.h
parentMerge "updater: Remove some obsoleted functions for file-based OTA." am: 342717d148 am: 000f364c19 (diff)
downloadandroid_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar.gz
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar.bz2
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar.lz
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar.xz
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.tar.zst
android_bootable_recovery-7b22c92ac1265f439f8e2623c4a1d6b45bbb05f2.zip
Diffstat (limited to 'verifier.h')
-rw-r--r--verifier.h14
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);