summaryrefslogtreecommitdiffstats
path: root/verifier.cpp
diff options
context:
space:
mode:
authorTao Bao <tbao@google.com>2016-04-23 02:08:10 +0200
committerandroid-build-merger <android-build-merger@google.com>2016-04-23 02:08:10 +0200
commite93c43fc6678dc5f923aedc6594d058f67b3c3d0 (patch)
tree87ac1837109158992b884e8aa2ffe9ec1b583740 /verifier.cpp
parentMerge "Go back to the old ear-wiggling Android animation. am: 692941be79 am: 87b0654f00" into nyc-mr1-dev-plus-aosp (diff)
parentMerge "recovery: Dump the signature in the zip package." into nyc-dev am: 34ca089 (diff)
downloadandroid_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar.gz
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar.bz2
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar.lz
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar.xz
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.tar.zst
android_bootable_recovery-e93c43fc6678dc5f923aedc6594d058f67b3c3d0.zip
Diffstat (limited to 'verifier.cpp')
-rw-r--r--verifier.cpp17
1 files changed, 15 insertions, 2 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 523990561..996a1fdf9 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -28,6 +28,7 @@
#include "asn1_decoder.h"
#include "common.h"
+#include "print_sha1.h"
#include "ui.h"
#include "verifier.h"
@@ -231,9 +232,14 @@ int verify_file(unsigned char* addr, size_t length,
uint8_t* sig_der = nullptr;
size_t sig_der_length = 0;
+ uint8_t* signature = eocd + eocd_size - signature_start;
size_t signature_size = signature_start - FOOTER_SIZE;
- if (!read_pkcs7(eocd + eocd_size - signature_start, signature_size, &sig_der,
- &sig_der_length)) {
+
+ LOGI("signature (offset: 0x%zx, length: %zu): %s\n",
+ length - signature_start, signature_size,
+ print_hex(signature, signature_size).c_str());
+
+ if (!read_pkcs7(signature, signature_size, &sig_der, &sig_der_length)) {
LOGE("Could not find signature DER block\n");
return VERIFY_FAILURE;
}
@@ -288,6 +294,13 @@ int verify_file(unsigned char* addr, size_t length,
}
i++;
}
+
+ if (need_sha1) {
+ LOGI("SHA-1 digest: %s\n", print_hex(sha1, SHA_DIGEST_LENGTH).c_str());
+ }
+ if (need_sha256) {
+ LOGI("SHA-256 digest: %s\n", print_hex(sha256, SHA256_DIGEST_LENGTH).c_str());
+ }
free(sig_der);
LOGE("failed to verify whole-file signature\n");
return VERIFY_FAILURE;