nwztool: fix computation

It turns out the calculation gives the right result for the wrong reason, this
fixes it.

Change-Id: I36053c8993b5ae1e85380da59546ffade265fb3f
This commit is contained in:
Amaury Pouly 2020-10-11 13:07:04 +02:00
parent 8ce60c54f7
commit e371dee4a3

View file

@ -165,7 +165,7 @@ struct upg_file_t *upg_read_memory(void *buf, size_t size, const char *key,
/* check MD5 */
uint8_t actual_md5[NWZ_MD5_SIZE];
MD5_CalculateDigest(actual_md5, (md5 + 1), size - sizeof(struct upg_header_t));
MD5_CalculateDigest(actual_md5, (md5 + 1), size - NWZ_MD5_SIZE);
if(memcmp(actual_md5, md5->md5, NWZ_MD5_SIZE) != 0)
{
cprintf(RED, "Mismatch\n");