summaryrefslogtreecommitdiffstats
path: root/verifier_test.cpp
diff options
context:
space:
mode:
authorDoug Zongker <dougz@android.com>2014-01-13 23:16:58 +0100
committerDoug Zongker <dougz@android.com>2014-01-16 22:29:28 +0100
commit99916f0496cfe37891d40f21a9a0e387620a8a60 (patch)
tree6b457a65cfdf482fec027386fcd7d197586c67b2 /verifier_test.cpp
parentam a01b6467: am 772f6e2a: Merge "correctly mount tmpfs as /tmp in recovery" (diff)
downloadandroid_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.gz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.bz2
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.lz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.xz
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.tar.zst
android_bootable_recovery-99916f0496cfe37891d40f21a9a0e387620a8a60.zip
Diffstat (limited to 'verifier_test.cpp')
-rw-r--r--verifier_test.cpp12
1 files changed, 11 insertions, 1 deletions
diff --git a/verifier_test.cpp b/verifier_test.cpp
index 88fcad4ea..10a5ddaad 100644
--- a/verifier_test.cpp
+++ b/verifier_test.cpp
@@ -17,12 +17,16 @@
#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>
+#include <sys/types.h>
+#include <sys/stat.h>
+#include <fcntl.h>
#include "common.h"
#include "verifier.h"
#include "ui.h"
#include "mincrypt/sha.h"
#include "mincrypt/sha256.h"
+#include "minzip/SysUtil.h"
// This is build/target/product/security/testkey.x509.pem after being
// dumped out by dumpkey.jar.
@@ -227,7 +231,13 @@ int main(int argc, char **argv) {
ui = new FakeUI();
- int result = verify_file(argv[argn], certs, num_keys);
+ MemMapping map;
+ if (sysMapFile(argv[argn], &map) != 0) {
+ fprintf(stderr, "failed to mmap %s: %s\n", argv[argn], strerror(errno));
+ return 4;
+ }
+
+ int result = verify_file(map.addr, map.length, certs, num_keys);
if (result == VERIFY_SUCCESS) {
printf("VERIFIED\n");
return 0;