diff options
author | Tao Bao <tbao@google.com> | 2016-02-03 18:16:56 +0100 |
---|---|---|
committer | Gerrit Code Review <noreply-gerritcodereview@google.com> | 2016-02-03 18:16:56 +0100 |
commit | 351ddbbc0a8ff1257f5ad963c850204558a38d70 (patch) | |
tree | d588a2f9f86e0eac79c9aeb2dcb1591353229272 /install.cpp | |
parent | Merge "uncrypt: generate map file by renaming tmp file." (diff) | |
parent | recovery: Refactor verifier and verifier_test. (diff) | |
download | android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar.gz android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar.bz2 android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar.lz android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar.xz android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.tar.zst android_bootable_recovery-351ddbbc0a8ff1257f5ad963c850204558a38d70.zip |
Diffstat (limited to '')
-rw-r--r-- | install.cpp | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/install.cpp b/install.cpp index 7d88ed72a..c0d007709 100644 --- a/install.cpp +++ b/install.cpp @@ -23,6 +23,8 @@ #include <sys/wait.h> #include <unistd.h> +#include <vector> + #include "common.h" #include "install.h" #include "mincrypt/rsa.h" @@ -221,19 +223,16 @@ really_install_package(const char *path, bool* wipe_cache, bool needs_mount) return INSTALL_CORRUPT; } - int numKeys; - Certificate* loadedKeys = load_keys(PUBLIC_KEYS_FILE, &numKeys); - if (loadedKeys == NULL) { + std::vector<Certificate> loadedKeys; + if (!load_keys(PUBLIC_KEYS_FILE, loadedKeys)) { LOGE("Failed to load keys\n"); return INSTALL_CORRUPT; } - LOGI("%d key(s) loaded from %s\n", numKeys, PUBLIC_KEYS_FILE); + LOGI("%zu key(s) loaded from %s\n", loadedKeys.size(), PUBLIC_KEYS_FILE); ui->Print("Verifying update package...\n"); - int err; - err = verify_file(map.addr, map.length, loadedKeys, numKeys); - free(loadedKeys); + int err = verify_file(map.addr, map.length, loadedKeys); LOGI("verify_file returned %d\n", err); if (err != VERIFY_SUCCESS) { LOGE("signature verification failed\n"); |