summaryrefslogtreecommitdiffstats
path: root/install.cpp
diff options
context:
space:
mode:
authorandroid-build-team Robot <android-build-team-robot@google.com>2018-10-24 05:11:46 +0200
committerandroid-build-team Robot <android-build-team-robot@google.com>2018-10-24 05:11:46 +0200
commit36c6222be4084180e7dc5a9ff3283c86fdcdc3a7 (patch)
treea911f5de7d3972133283298037554308d5ad5c0d /install.cpp
parentSnap for 5082210 from 3d5a941b0b1671c3ccc3dd25faa2cd7de738b0b0 to qt-release (diff)
parentMerge "Add a function to construct the GRSurface in test" am: ee9c65a38e am: e100c9f491 (diff)
downloadandroid_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar.gz
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar.bz2
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar.lz
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar.xz
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.tar.zst
android_bootable_recovery-36c6222be4084180e7dc5a9ff3283c86fdcdc3a7.zip
Diffstat (limited to 'install.cpp')
-rw-r--r--install.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/install.cpp b/install.cpp
index e379ef307..42d264157 100644
--- a/install.cpp
+++ b/install.cpp
@@ -695,18 +695,18 @@ int install_package(const std::string& path, bool* wipe_cache, bool needs_mount,
}
bool verify_package(const unsigned char* package_data, size_t package_size) {
- static constexpr const char* PUBLIC_KEYS_FILE = "/res/keys";
- std::vector<Certificate> loadedKeys;
- if (!load_keys(PUBLIC_KEYS_FILE, loadedKeys)) {
+ static constexpr const char* CERTIFICATE_ZIP_FILE = "/system/etc/security/otacerts.zip";
+ std::vector<Certificate> loaded_keys = LoadKeysFromZipfile(CERTIFICATE_ZIP_FILE);
+ if (loaded_keys.empty()) {
LOG(ERROR) << "Failed to load keys";
return false;
}
- LOG(INFO) << loadedKeys.size() << " key(s) loaded from " << PUBLIC_KEYS_FILE;
+ LOG(INFO) << loaded_keys.size() << " key(s) loaded from " << CERTIFICATE_ZIP_FILE;
// Verify package.
ui->Print("Verifying update package...\n");
auto t0 = std::chrono::system_clock::now();
- int err = verify_file(package_data, package_size, loadedKeys,
+ int err = verify_file(package_data, package_size, loaded_keys,
std::bind(&RecoveryUI::SetProgress, ui, std::placeholders::_1));
std::chrono::duration<double> duration = std::chrono::system_clock::now() - t0;
ui->Print("Update package verification took %.1f s (result %d).\n", duration.count(), err);