mirror of
https://github.com/Proxmark/proxmark3.git
synced 2025-08-22 06:13:27 -07:00
some improvements in APDU response checking
This commit is contained in:
parent
b1eb10c8d3
commit
117f0df729
2 changed files with 12 additions and 6 deletions
|
@ -134,7 +134,7 @@ int CmdHFFidoRegister(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
res = FIDORegister(data, buf, sizeof(buf), &len, &sw);
|
res = FIDORegister(data, buf, sizeof(buf), &len, &sw);
|
||||||
/* if (res) {
|
if (res) {
|
||||||
PrintAndLog("Can't execute register command. res=%x. Exit...", res);
|
PrintAndLog("Can't execute register command. res=%x. Exit...", res);
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
@ -142,9 +142,10 @@ int CmdHFFidoRegister(const char *cmd) {
|
||||||
if (sw != 0x9000) {
|
if (sw != 0x9000) {
|
||||||
PrintAndLog("Can't execute register command. APDU response status: %04x - %s", sw, GetAPDUCodeDescription(sw >> 8, sw & 0xff));
|
PrintAndLog("Can't execute register command. APDU response status: %04x - %s", sw, GetAPDUCodeDescription(sw >> 8, sw & 0xff));
|
||||||
return 3;
|
return 3;
|
||||||
}*/
|
}
|
||||||
|
|
||||||
//PrintAndLog("data: %s", sprint_hex(buf, len));
|
PrintAndLog("---------------------------------------------------------------");
|
||||||
|
PrintAndLog("data len: %d", len);
|
||||||
|
|
||||||
if (buf[0] != 0x05) {
|
if (buf[0] != 0x05) {
|
||||||
PrintAndLog("ERROR: First byte must be 0x05, but it %2x", buf[0]);
|
PrintAndLog("ERROR: First byte must be 0x05, but it %2x", buf[0]);
|
||||||
|
|
|
@ -255,10 +255,15 @@ int EMVExchangeEx(bool ActivateField, bool LeaveFieldON, sAPDU apdu, bool Includ
|
||||||
*sw = isw;
|
*sw = isw;
|
||||||
|
|
||||||
if (isw != 0x9000) {
|
if (isw != 0x9000) {
|
||||||
if (APDULogging)
|
if (APDULogging) {
|
||||||
|
if (*sw >> 8 == 0x61) {
|
||||||
|
PrintAndLog("APDU chaining len:%02x -->", *sw & 0xff);
|
||||||
|
} else {
|
||||||
PrintAndLog("APDU(%02x%02x) ERROR: [%4X] %s", apdu.CLA, apdu.INS, isw, GetAPDUCodeDescription(*sw >> 8, *sw & 0xff));
|
PrintAndLog("APDU(%02x%02x) ERROR: [%4X] %s", apdu.CLA, apdu.INS, isw, GetAPDUCodeDescription(*sw >> 8, *sw & 0xff));
|
||||||
return 5;
|
return 5;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// add to tlv tree
|
// add to tlv tree
|
||||||
if (tlv) {
|
if (tlv) {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue