New API calls iso_write_opts_set_record_md5(), iso_read_opts_set_no_md5()

This commit is contained in:
2009-08-10 21:23:30 +02:00
parent b5f4a66c59
commit 429b4cd21c
6 changed files with 134 additions and 46 deletions

View File

@@ -457,11 +457,15 @@ int checksum_writer_write_data(IsoImageWriter *writer)
iso_msg_debug(t->image->id, "Writing Checksums...");
/* Write image checksum to index 0 */
/* >>> rather fork a result than killing t->checksum_ctx */;
res = libisofs_md5(&(t->checksum_ctx), NULL, 0, t->image_md5,
2 | (1 << 15));
if (res > 0)
memcpy(t->checksum_buffer + 0, t->image_md5, 16);
if (t->checksum_ctx != NULL) {
/* >>> rather fork a result than killing t->checksum_ctx */;
res = libisofs_md5(&(t->checksum_ctx), NULL, 0, t->image_md5,
2 | (1 << 15));
if (res > 0)
memcpy(t->checksum_buffer + 0, t->image_md5, 16);
}
size = (t->checksum_idx_counter + 2) / 128 + 1;