mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 06:13:27 -07:00
fix emv search behavior
(taken from PRs 261 and 262 by @merlokk on https://github.com/RfidResearchGroup/proxmark3) whitespace fixes
This commit is contained in:
parent
88b3dada70
commit
c42b7d4d74
1 changed files with 38 additions and 33 deletions
|
@ -579,14 +579,16 @@ int EMVSearch(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON,
|
||||||
int retrycnt = 0;
|
int retrycnt = 0;
|
||||||
for(int i = 0; i < AIDlistLen; i ++) {
|
for(int i = 0; i < AIDlistLen; i ++) {
|
||||||
param_gethex_to_eol(AIDlist[i].aid, 0, aidbuf, sizeof(aidbuf), &aidlen);
|
param_gethex_to_eol(AIDlist[i].aid, 0, aidbuf, sizeof(aidbuf), &aidlen);
|
||||||
res = EMVSelect(channel, (i == 0) ? ActivateField : false, (i == AIDlistLen - 1) ? LeaveFieldON : true, aidbuf, aidlen, data, sizeof(data), &datalen, &sw, tlv);
|
res = EMVSelect(channel, (i == 0) ? ActivateField : false, true, aidbuf, aidlen, data, sizeof(data), &datalen, &sw, tlv);
|
||||||
// retry if error and not returned sw error
|
// retry if error and not returned sw error
|
||||||
if (res && res != 5) {
|
if (res && res != 5) {
|
||||||
if (++retrycnt < 3){
|
if (++retrycnt < 3){
|
||||||
i--;
|
i--;
|
||||||
} else {
|
} else {
|
||||||
// (1) - card select error, proxmark error OR (200) - result length = 0
|
// (1) - card select error, (4) reply timeout, (200) - result length = 0
|
||||||
if (res == 1 || res == 200) {
|
if (res == 1 || res == 4 || res == 200) {
|
||||||
|
if (!LeaveFieldON)
|
||||||
|
DropFieldEx(channel);
|
||||||
PrintAndLogEx(WARNING, "Exit...");
|
PrintAndLogEx(WARNING, "Exit...");
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
@ -610,6 +612,9 @@ int EMVSearch(EMVCommandChannel channel, bool ActivateField, bool LeaveFieldON,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (!LeaveFieldON)
|
||||||
|
DropFieldEx(channel);
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue