summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-02-02 23:02:27 +0100
committerTao Bao <tbao@google.com>2016-02-03 06:51:32 +0100
commit71e3e09ec2ac4f022e8f9213657746d8cad5dd97 (patch)
treed588a2f9f86e0eac79c9aeb2dcb1591353229272 /install.cpp
parentMerge "uncrypt: generate map file by renaming tmp file." (diff)
downloadandroid_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar.gz
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar.bz2
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar.lz
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar.xz
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.tar.zst
android_bootable_recovery-71e3e09ec2ac4f022e8f9213657746d8cad5dd97.zip
Diffstat (limited to 'install.cpp')
-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");