aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu2017-01-18 16:34:18 -0600
committerandroid-build-merger2017-01-18 16:34:18 -0600
commitca50d7b66a187855d5ff53e95ec5286701f29d80 (patch)
tree7e1ccedcc9c9bab2038cd5e4bf88f2402554756d /verifier.cpp
parentb8c1788e7b4b63b2cc4ed2ecf7728da816301f42 (diff)
parent15ca2a476378bc5440252c834a024560455664e1 (diff)
downloadplatform-bootable-recovery-ca50d7b66a187855d5ff53e95ec5286701f29d80.tar.gz
platform-bootable-recovery-ca50d7b66a187855d5ff53e95ec5286701f29d80.tar.xz
platform-bootable-recovery-ca50d7b66a187855d5ff53e95ec5286701f29d80.zip
Add a checker for signature boundary in verifier am: 54ea136fde am: 0a34b17c8b am: fb80b4f72d am: d3d5e54a45 am: 6ea9888d51 am: a055eb93c3
am: 15ca2a4763 Change-Id: I5481d39f0d2fdb92c95e964d2a55512f4df3acb3
Diffstat (limited to 'verifier.cpp')
-rw-r--r--verifier.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/verifier.cpp b/verifier.cpp
index 16cc7cf0..2d1b0e74 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -146,6 +146,12 @@ int verify_file(unsigned char* addr, size_t length,
146 LOGI("comment is %zu bytes; signature %zu bytes from end\n", 146 LOGI("comment is %zu bytes; signature %zu bytes from end\n",
147 comment_size, signature_start); 147 comment_size, signature_start);
148 148
149 if (signature_start > comment_size) {
150 LOGE("signature start: %zu is larger than comment size: %zu\n", signature_start,
151 comment_size);
152 return VERIFY_FAILURE;
153 }
154
149 if (signature_start <= FOOTER_SIZE) { 155 if (signature_start <= FOOTER_SIZE) {
150 LOGE("Signature start is in the footer"); 156 LOGE("Signature start is in the footer");
151 return VERIFY_FAILURE; 157 return VERIFY_FAILURE;