diff options
Diffstat (limited to 'verifier.cpp')
-rw-r--r-- | verifier.cpp | 18 |
1 files changed, 13 insertions, 5 deletions
diff --git a/verifier.cpp b/verifier.cpp index 16cc7cf03..c4cd612c7 100644 --- a/verifier.cpp +++ b/verifier.cpp @@ -31,7 +31,9 @@ #include "ui.h" #include "verifier.h" -extern RecoveryUI* ui; +//extern RecoveryUI* ui; + +#define PUBLIC_KEYS_FILE "/res/keys" static constexpr size_t MiB = 1024 * 1024; @@ -114,9 +116,15 @@ static bool read_pkcs7(uint8_t* pkcs7_der, size_t pkcs7_der_len, uint8_t** sig_d // Return VERIFY_SUCCESS, VERIFY_FAILURE (if any error is encountered // or no key matches the signature). -int verify_file(unsigned char* addr, size_t length, - const std::vector<Certificate>& keys) { - ui->SetProgress(0.0); +int verify_file(unsigned char* addr, size_t length) { + //ui->SetProgress(0.0); + + std::vector<Certificate> keys; + if (!load_keys(PUBLIC_KEYS_FILE, keys)) { + LOGE("Failed to load keys\n"); + return INSTALL_CORRUPT; + } + LOGI("%d key(s) loaded from %s\n", keys.size(), PUBLIC_KEYS_FILE); // An archive with a whole-file signature will end in six bytes: // @@ -218,7 +226,7 @@ int verify_file(unsigned char* addr, size_t length, double f = so_far / (double)signed_len; if (f > frac + 0.02 || size == so_far) { - ui->SetProgress(f); + //ui->SetProgress(f); frac = f; } } |