Fix bug in sha256 verify
authorJens Axboe <jens.axboe@oracle.com>
Tue, 23 Feb 2010 09:36:21 +0000 (10:36 +0100)
committerJens Axboe <jens.axboe@oracle.com>
Tue, 23 Feb 2010 09:36:21 +0000 (10:36 +0100)
It was using twice as large data block as it should have been,
causing verify failures.

Signed-off-by: Jens Axboe <jens.axboe@oracle.com>
verify.c
verify.h

index 59f1ddf341e6d5add86a3c2874137ec78870afda..c894b600525c5969d5ddefb1d9eafe51c6a7ece9 100644 (file)
--- a/verify.c
+++ b/verify.c
@@ -212,7 +212,7 @@ static int verify_io_u_sha256(struct verify_header *hdr, struct io_u *io_u,
 {
        void *p = io_u_verify_off(hdr, io_u, header_num);
        struct vhdr_sha256 *vh = hdr_priv(hdr);
-       uint8_t sha256[128];
+       uint8_t sha256[64];
        struct sha256_ctx sha256_ctx = {
                .buf = sha256,
        };
index c12bc7d0a7a1babb2c266358a05b2a73df4c6c0a..be98c5460a3662ed915cacfa0c6d078738427c3f 100644 (file)
--- a/verify.h
+++ b/verify.h
@@ -37,7 +37,7 @@ struct vhdr_sha512 {
        uint8_t sha512[128];
 };
 struct vhdr_sha256 {
-       uint8_t sha256[128];
+       uint8_t sha256[64];
 };
 struct vhdr_sha1 {
        uint32_t sha1[5];