Avoiding to equip old session nodes with 0-MD5 if the checksum array

was not loaded during own checksum mismatch.
This commit is contained in:
Thomas Schmitt 2009-08-13 23:34:55 +02:00
parent 74198afa04
commit ba66a7896a
2 changed files with 16 additions and 9 deletions

View File

@ -906,6 +906,9 @@ int checksum_prepare_nodes(Ecma119Image *target, IsoNode *node, int flag)
unsigned int idx = 0;
char *value;
void *xipt = NULL;
static char *cx_names = "isofs.cx";
static size_t cx_value_lengths[1] = {0};
char *cx_valuept = "";
img= target->image;
@ -917,7 +920,12 @@ int checksum_prepare_nodes(Ecma119Image *target, IsoNode *node, int flag)
value= NULL;
ret = iso_node_lookup_attr(node, "isofs.cx", &value_length,
&value, 0);
if (ret == 1 && value_length == 4) {
if (ret == 1 && img->checksum_array == NULL) {
/* No checksum array loaded. Delete "isofs.cx" */
iso_node_set_attrs(node, (size_t) 1,
&cx_names, cx_value_lengths, &cx_valuept, 4 | 8);
no_md5 = 1;
} else if (ret == 1 && value_length == 4) {
for (i = 0; i < 4; i++)
idx = (idx << 8) | ((unsigned char *) value)[i];
if (idx > 0 && idx < 0x8000000) {

View File

@ -5241,14 +5241,6 @@ int iso_md5_end(void **md5_context, char result[16]);
*/
#define ISO_FILE_IMGPATH_WRONG 0xD020FF70
/**
* Checksum array appears damaged and not trustworthy for verifications.
* (WARNING,HIGH, -145)
* @since 0.6.22
*/
#define ISO_MD5_ARRAY_CORRUPTED 0xD030FF6F
/**
* Offset greater than file size (FAILURE,HIGH, -150)
* @since 0.6.4
@ -5373,6 +5365,13 @@ int iso_md5_end(void **md5_context, char result[16]);
/** Premature EOF of zlib input stream (FAILURE, HIGH, -351) */
#define ISO_ZLIB_EARLY_EOF 0xE830FEA1
/**
* Checksum array appears damaged and not trustworthy for verifications.
* (WARNING,HIGH, -352)
* @since 0.6.22
*/
#define ISO_MD5_ARRAY_CORRUPTED 0xD030FEA0
/* ! PLACE NEW ERROR CODES HERE ! */