summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-02-03 18:49:46 +0100
committerandroid-build-merger <android-build-merger@google.com>2016-02-03 18:49:46 +0100
commit344f5c5c39fffcc4b591072a5927b5e28cea8c72 (patch)
treef44cdc31657fe10bf4a70098fb84c8c3b33d0562 /install.cpp
parentMerge "uncrypt: generate map file by renaming tmp file." am: 4c07a7ec05 (diff)
parentMerge "recovery: Refactor verifier and verifier_test." (diff)
downloadandroid_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar.gz
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar.bz2
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar.lz
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar.xz
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.tar.zst
android_bootable_recovery-344f5c5c39fffcc4b591072a5927b5e28cea8c72.zip
Diffstat (limited to '')
-rw-r--r--install.cpp13
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");