struct loc_database_magic magic;
fread(&magic, 1, sizeof(magic), f);
+ hexdump(writer->ctx, &magic, sizeof(magic));
+
// Feed magic into the signature
r = EVP_DigestSignUpdate(mdctx, &magic, sizeof(magic));
if (r != 1) {
goto END;
}
+ hexdump(writer->ctx, header, sizeof(*header));
+
// 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];
goto END;
}
+ hexdump(writer->ctx, buffer, bytes_read);
+
r = EVP_DigestSignUpdate(mdctx, buffer, bytes_read);
if (r != 1) {
ERROR(writer->ctx, "%s\n", ERR_error_string(ERR_get_error(), NULL));
for (unsigned int i = 0; i < sizeof(header.signature); i++)
header.signature[i] = '\0';
+ // Clear the padding
+ for (unsigned int i = 0; i < sizeof(header.padding); i++)
+ header.padding[i] = '\0';
+
int r;
off_t offset = 0;