#include "cmdsmartcard.h"
#include <ctype.h>
+#include <string.h>
#include "ui.h"
#include "cmdparser.h"
return 0;
}
-static bool smart_getATR(smart_card_atr_t *card)
+bool smart_getATR(smart_card_atr_t *card)
{
if (UseAlternativeSmartcardReader) {
return pcscGetATR(card);
if (!silent) PrintAndLogEx(WARNING, "smart card select failed");
return 1;
}
+
+ if (!card.atr_len) {
+ if (!silent) PrintAndLogEx(ERR, "can't get ATR from a smart card");
+ return 1;
+ }
// print header
PrintAndLogEx(INFO, "--- Smartcard Information ---------");
static int CmdSmartList(const char *Cmd) {
- CmdHFList("7816");
+ if (UseAlternativeSmartcardReader) {
+ CmdHFList("7816 p");
+ } else {
+ CmdHFList("7816");
+ }
return 0;
}