]> git.ipfire.org Git - people/ms/libloc.git/commitdiff
writer: Put whole header into the hash instead of only the first 8 bytes
authorMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Dec 2019 13:02:44 +0000 (13:02 +0000)
committerMichael Tremer <michael.tremer@ipfire.org>
Thu, 12 Dec 2019 13:02:44 +0000 (13:02 +0000)
Signed-off-by: Michael Tremer <michael.tremer@ipfire.org>
src/writer.c

index 26d5c32f3eb96c2266b700d88e8bc2757d4b6e89..6c748058bd5cadd6264548866cd1af8de139ef67 100644 (file)
@@ -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];