mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-20 21:33:47 -07:00
Replace WITH_SMARTCARD by dynamic detection in client
This commit is contained in:
parent
cad676a23c
commit
6b2677c154
2 changed files with 19 additions and 23 deletions
|
@ -809,13 +809,12 @@ static int CmdEMVExec(const char *Cmd) {
|
||||||
uint8_t psenum = (channel == ECC_CONTACT) ? 1 : 2;
|
uint8_t psenum = (channel == ECC_CONTACT) ? 1 : 2;
|
||||||
CLIParserFree();
|
CLIParserFree();
|
||||||
|
|
||||||
#ifndef WITH_SMARTCARD
|
if (!IfPm3Smartcard()) {
|
||||||
// not compiled with smartcard functionality, we need to exit
|
if (channel == ECC_CONTACT) {
|
||||||
if (channel == ECC_CONTACT) {
|
PrintAndLogEx(WARNING, "PM3 does not have SMARTCARD support. Exiting.");
|
||||||
PrintAndLogEx(WARNING, "PM3 Client is not compiled with support for SMARTCARD. Exiting.");
|
return PM3_EDEVNOTSUPP;
|
||||||
return PM3_EDEVNOTSUPP;
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
SetAPDULogging(showAPDU);
|
SetAPDULogging(showAPDU);
|
||||||
|
|
||||||
|
@ -1400,13 +1399,12 @@ static int CmdEMVScan(const char *Cmd) {
|
||||||
CLIGetStrWithReturn(12, relfname, &relfnamelen);
|
CLIGetStrWithReturn(12, relfname, &relfnamelen);
|
||||||
CLIParserFree();
|
CLIParserFree();
|
||||||
|
|
||||||
#ifndef WITH_SMARTCARD
|
if (!IfPm3Smartcard()) {
|
||||||
// not compiled with smartcard functionality, we need to exit
|
if (channel == ECC_CONTACT) {
|
||||||
if (channel == ECC_CONTACT) {
|
PrintAndLogEx(WARNING, "PM3 does not have SMARTCARD support. Exiting.");
|
||||||
PrintAndLogEx(ERR, "PM3 Client is not compiled with support for SMARTCARD. Exiting.");
|
return PM3_EDEVNOTSUPP;
|
||||||
return PM3_EDEVNOTSUPP;
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
SetAPDULogging(showAPDU);
|
SetAPDULogging(showAPDU);
|
||||||
|
|
||||||
|
@ -1736,13 +1734,12 @@ static int CmdEMVRoca(const char *Cmd) {
|
||||||
PrintChannel(channel);
|
PrintChannel(channel);
|
||||||
CLIParserFree();
|
CLIParserFree();
|
||||||
|
|
||||||
#ifndef WITH_SMARTCARD
|
if (!IfPm3Smartcard()) {
|
||||||
// not compiled with smartcard functionality, we need to exit
|
if (channel == ECC_CONTACT) {
|
||||||
if (channel == ECC_CONTACT) {
|
PrintAndLogEx(WARNING, "PM3 does not have SMARTCARD support. Exiting.");
|
||||||
PrintAndLogEx(WARNING, "PM3 Client is not compiled with support for SMARTCARD. Exiting.");
|
return PM3_EDEVNOTSUPP;
|
||||||
return PM3_EDEVNOTSUPP;
|
}
|
||||||
}
|
}
|
||||||
#endif
|
|
||||||
|
|
||||||
// select card
|
// select card
|
||||||
uint8_t psenum = (channel == ECC_CONTACT) ? 1 : 2;
|
uint8_t psenum = (channel == ECC_CONTACT) ? 1 : 2;
|
||||||
|
|
|
@ -293,11 +293,10 @@ static int EMVExchangeEx(EMVCommandChannel channel, bool ActivateField, bool Lea
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case ECC_CONTACT:
|
case ECC_CONTACT:
|
||||||
#ifdef WITH_SMARTCARD
|
if (IfPm3Smartcard())
|
||||||
res = ExchangeAPDUSC(data, (IncludeLe ? 6 : 5) + apdu.Lc, ActivateField, LeaveFieldON, Result, (int)MaxResultLen, (int *)ResultLen);
|
res = ExchangeAPDUSC(data, (IncludeLe ? 6 : 5) + apdu.Lc, ActivateField, LeaveFieldON, Result, (int)MaxResultLen, (int *)ResultLen);
|
||||||
#else
|
else
|
||||||
res = 1;
|
res = 1;
|
||||||
#endif
|
|
||||||
if (res) {
|
if (res) {
|
||||||
return res;
|
return res;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue