Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit a055eb93 authored by Tianjie Xu's avatar Tianjie Xu Committed by android-build-merger
Browse files

Add a checker for signature boundary in verifier am: 54ea136f am: 0a34b17c...

Add a checker for signature boundary in verifier am: 54ea136f am: 0a34b17c am: fb80b4f7 am: d3d5e54a
am: 6ea9888d

Change-Id: I7bbabdbe543c54f18dd42cb64030ca2174bf9bf2
parents 195ff7f7 6ea9888d
Loading
Loading
Loading
Loading
+6 −0
Original line number Diff line number Diff line
@@ -144,6 +144,12 @@ int verify_file(unsigned char* addr, size_t length,
    LOGI("comment is %zu bytes; signature %zu bytes from end\n",
         comment_size, signature_start);

    if (signature_start > comment_size) {
        LOGE("signature start: %zu is larger than comment size: %zu\n", signature_start,
             comment_size);
        return VERIFY_FAILURE;
    }

    if (signature_start <= FOOTER_SIZE) {
        LOGE("Signature start is in the footer");
        return VERIFY_FAILURE;