aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTianjie Xu2017-01-18 16:42:19 -0600
committerandroid-build-merger2017-01-18 16:42:19 -0600
commit8a45adb24393bca4f03f1b12e74ae4961fd1d72b (patch)
treebedafec347c1800119dbab70539c428ff9ffb66c /verifier.cpp
parent54890af615c0f5a1cd052770bf96bf0227102802 (diff)
parente0d3b0ceab7de3ada458b698a8162cee47781dff (diff)
downloadplatform-bootable-recovery-8a45adb24393bca4f03f1b12e74ae4961fd1d72b.tar.gz
platform-bootable-recovery-8a45adb24393bca4f03f1b12e74ae4961fd1d72b.tar.xz
platform-bootable-recovery-8a45adb24393bca4f03f1b12e74ae4961fd1d72b.zip
Add a checker for signature boundary in verifier am: 54ea136fde am: 0a34b17c8b am: fb80b4f72d am: d3d5e54a45 am: 6ea9888d51 am: a055eb93c3 am: 15ca2a4763 am: ca50d7b66a am: 64f0de7a13 am: e4ec60e045
am: e0d3b0ceab Change-Id: I4fe8bdd81f8250b862b0018f0a52a76d37ee9d88
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 44098f70..22f15235 100644
--- a/verifier.cpp
+++ b/verifier.cpp
@@ -147,6 +147,12 @@ int verify_file(unsigned char* addr, size_t length,
147 LOG(INFO) << "comment is " << comment_size << " bytes; signature is " << signature_start 147 LOG(INFO) << "comment is " << comment_size << " bytes; signature is " << signature_start
148 << " bytes from end"; 148 << " bytes from end";
149 149
150 if (signature_start > comment_size) {
151 LOGE("signature start: %zu is larger than comment size: %zu\n", signature_start,
152 comment_size);
153 return VERIFY_FAILURE;
154 }
155
150 if (signature_start <= FOOTER_SIZE) { 156 if (signature_start <= FOOTER_SIZE) {
151 LOG(ERROR) << "Signature start is in the footer"; 157 LOG(ERROR) << "Signature start is in the footer";
152 return VERIFY_FAILURE; 158 return VERIFY_FAILURE;