From: Michael Tremer Date: Thu, 12 Dec 2019 13:02:44 +0000 (+0000) Subject: writer: Put whole header into the hash instead of only the first 8 bytes X-Git-Tag: 0.9.1~85 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=72633a8512eec522b69cdff3ae7a79a4fc440d40;p=people%2Fms%2Flibloc.git writer: Put whole header into the hash instead of only the first 8 bytes Signed-off-by: Michael Tremer --- diff --git a/src/writer.c b/src/writer.c index 26d5c32..6c74805 100644 --- a/src/writer.c +++ b/src/writer.c @@ -538,14 +538,14 @@ static int loc_writer_create_signature(struct loc_writer* writer, } // Feed the header into the signature - r = EVP_DigestSignUpdate(mdctx, header, sizeof(header)); + r = EVP_DigestSignUpdate(mdctx, header, sizeof(*header)); if (r != 1) { ERROR(writer->ctx, "%s\n", ERR_error_string(ERR_get_error(), NULL)); goto END; } // Skip header - fseek(f, sizeof(header), SEEK_CUR); + fseek(f, sizeof(*header), SEEK_CUR); // Walk through the file in chunks of 64kB char buffer[64 * 1024];