Initial implementation of MD5 checksums for session and single data files.

To be activated by macro Libisofs_with_checksumS.
New AAIP attributes "isfs.ca" and "isofs.cx".
New API calls iso_image_get_session_md5() and iso_file_get_md5().
This commit is contained in:
2009-08-10 13:56:06 +02:00
parent 55690756ae
commit b5f4a66c59
15 changed files with 1349 additions and 40 deletions

View File

@ -78,6 +78,14 @@ int iso_image_new(const char *name, IsoImage **image)
img->inode_counter = 0;
img->used_inodes = NULL;
img->used_inodes_start = 0;
#ifdef Libisofs_with_checksumS
img->checksum_start_lba = 0;
img->checksum_end_lba = 0;
img->checksum_idx_count = 0;
img->checksum_array = NULL;
#endif
*image = img;
return ISO_SUCCESS;
}
@ -529,3 +537,25 @@ ex:;
return ret;
}
/* API */
int iso_image_get_session_md5(IsoImage *image, uint32_t *start_lba,
uint32_t *end_lba, char md5[16], int flag)
{
#ifdef Libisofs_with_checksumS
if (image->checksum_array == NULL || image->checksum_idx_count < 1)
return 0;
*start_lba = image->checksum_start_lba;
*end_lba = image->checksum_end_lba;
memcpy(md5, image->checksum_array, 16);
return ISO_SUCCESS;
#else
return 0;
#endif /* ! Libisofs_with_checksumS */
}