mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-25 23:55:25 -07:00
emrtd: Ensure that emrtd_parse_ef_sod_hash_algo returns -1 on errors too
This commit is contained in:
parent
03be720277
commit
d1ec96ed41
1 changed files with 3 additions and 2 deletions
|
@ -1544,6 +1544,9 @@ static int emrtd_parse_ef_sod_hash_algo(uint8_t *data, size_t datalen, int *hash
|
|||
uint8_t hashalgoset[64] = { 0x00 };
|
||||
size_t hashalgosetlen = 0;
|
||||
|
||||
// We'll return hash algo -1 if we can't find anything
|
||||
*hashalgo = -1;
|
||||
|
||||
if (!emrtd_lds_get_data_by_tag(data, datalen, hashalgoset, &hashalgosetlen, 0x30, 0x00, false, true, 0)) {
|
||||
PrintAndLogEx(ERR, "Failed to read hash algo set from EF_SOD.");
|
||||
return false;
|
||||
|
@ -1571,8 +1574,6 @@ static int emrtd_parse_ef_sod_hash_algo(uint8_t *data, size_t datalen, int *hash
|
|||
}
|
||||
}
|
||||
|
||||
// Return hash algo -1 if we can't find anything
|
||||
*hashalgo = -1;
|
||||
PrintAndLogEx(ERR, "Failed to parse hash list (Unknown algo: %s). Hash verification won't be available.", sprint_hex_inrow(hashalgoset, hashalgosetlen));
|
||||
return PM3_ESOFT;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue