Further enhancements of new API call iso_util_decode_md5_tag().

This commit is contained in:
2009-08-16 22:03:51 +02:00
parent 955471a064
commit 07a67a59e7
3 changed files with 45 additions and 33 deletions

View File

@ -5052,6 +5052,11 @@ int iso_file_get_md5(IsoImage *image, IsoFile *file, char md5[16], int flag);
* start and look out for a session tag on the fly. See doc/checksum.txt .
* @param data
* A complete and aligned data block read from an ISO image session.
* @param tag_type
* 0= no tag
* 1= session tag
* 2= superblock tag
* 3= tree tag
* @param pos
* Returns the LBA where the tag supposes itself to be stored.
* If this does not match the data block LBA then the tag might be
@ -5078,16 +5083,14 @@ int iso_file_get_md5(IsoImage *image, IsoFile *file, char md5[16], int flag);
* 3= tree tag
* @return
* 0= not a checksum tag, return parameters are invalid
* 1= session tag found
* 2= superblock tag found
* 3= tree tag found
* 1= checksum tag found, return parameters arevalid
* <0= error
* return parameters are valid with error ISO_MD5_AREA_CORRUPTED
* but not trustworthy because the tag seems corrupted.
*
* @since 0.6.22
*/
int iso_util_decode_md5_tag(char data[2048], uint32_t *pos,
int iso_util_decode_md5_tag(char data[2048], int *tag_type, uint32_t *pos,
uint32_t *range_start, uint32_t *range_size,
uint32_t *next_tag, char md5[16], int flag);

View File

@ -1563,7 +1563,7 @@ int iso_util_hex_to_bin(char *hex, char *bin, int bin_size, int *bin_count,
}
int iso_util_decode_md5_tag(char data[2048], uint32_t *pos,
int iso_util_decode_md5_tag(char data[2048], int *tag_type, uint32_t *pos,
uint32_t *range_start, uint32_t *range_size,
uint32_t *next_tag, char md5[16], int flag)
{
@ -1587,8 +1587,8 @@ int iso_util_decode_md5_tag(char data[2048], uint32_t *pos,
break;
if (i > magic_last )
return 0;
found = i;
cpt = data + magic_len[found] + 1;
*tag_type = i;
cpt = data + magic_len[*tag_type] + 1;
if (strncmp(cpt, "pos=", 4) != 0)
return 0;
cpt+= 4;
@ -1607,7 +1607,7 @@ int iso_util_decode_md5_tag(char data[2048], uint32_t *pos,
ret = iso_util_dec_to_uint32(cpt + 11, range_size, 0);
if (ret <= 0)
return 0;
if (found == 2 || found == 3) {
if (*tag_type == 2 || *tag_type == 3) {
cpt = strstr(cpt, "next=");
if (cpt == NULL)
return(0);
@ -1639,6 +1639,6 @@ int iso_util_decode_md5_tag(char data[2048], uint32_t *pos,
return ISO_MD5_AREA_CORRUPTED;
if (*(cpt + 5 + 32) != '\n')
return 0;
return(found);
return(1);
}