diff options
author | Tao Bao <tbao@google.com> | 2016-02-03 18:43:28 +0100 |
---|---|---|
committer | android-build-merger <android-build-merger@google.com> | 2016-02-03 18:43:28 +0100 |
commit | b177ead3d747d0565dd3e87bb2afa765ec7e54fc (patch) | |
tree | 706c122f98334cc3d316888708c0f9086a2b3b5d /install.cpp | |
parent | Merge "uncrypt: generate map file by renaming tmp file." (diff) | |
parent | Merge "recovery: Refactor verifier and verifier_test." (diff) | |
download | android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar.gz android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar.bz2 android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar.lz android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar.xz android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.tar.zst android_bootable_recovery-b177ead3d747d0565dd3e87bb2afa765ec7e54fc.zip |
Diffstat (limited to 'install.cpp')
-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"); |