aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
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 58083fe1..067dab55 100644
--- a/verifier.h
+++ b/verifier.h
@@ -17,6 +17,7 @@
17#ifndef _RECOVERY_VERIFIER_H 17#ifndef _RECOVERY_VERIFIER_H
18#define _RECOVERY_VERIFIER_H 18#define _RECOVERY_VERIFIER_H
19 19
20#include <functional>
20#include <memory> 21#include <memory>
21#include <vector> 22#include <vector>
22 23
@@ -58,13 +59,14 @@ struct Certificate {
58 std::unique_ptr<EC_KEY, ECKEYDeleter> ec; 59 std::unique_ptr<EC_KEY, ECKEYDeleter> ec;
59}; 60};
60 61
61/* addr and length define a an update package file that has been 62/*
62 * loaded (or mmap'ed, or whatever) into memory. Verify that the file 63 * 'addr' and 'length' define an update package file that has been loaded (or mmap'ed, or
63 * is signed and the signature matches one of the given keys. Return 64 * whatever) into memory. Verifies that the file is signed and the signature matches one of the
64 * one of the constants below. 65 * given keys. It optionally accepts a callback function for posting the progress to. Returns one
66 * of the constants of VERIFY_SUCCESS and VERIFY_FAILURE.
65 */ 67 */
66int verify_file(unsigned char* addr, size_t length, 68int verify_file(unsigned char* addr, size_t length, const std::vector<Certificate>& keys,
67 const std::vector<Certificate>& keys); 69 const std::function<void(float)>& set_progress = nullptr);
68 70
69bool load_keys(const char* filename, std::vector<Certificate>& certs); 71bool load_keys(const char* filename, std::vector<Certificate>& certs);
70 72