]> git.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdsmartcard.c
fix 'lf pcf7931 bruteforce' (bug reported in http://www.proxmark.org/forum/viewtopic...
[proxmark3-svn] / client / cmdsmartcard.c
index ac642fc992a5956fcea2f98fffaf5ed1c96084cf..b0d96f1320f422848b48c74c7d0ba5b55ef188f6 100644 (file)
@@ -311,7 +311,7 @@ static int PrintATR(uint8_t *atr, size_t atrlen) {
        return 0;
 }
 
        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 (UseAlternativeSmartcardReader) {
                return pcscGetATR(card);
@@ -804,6 +804,11 @@ static int CmdSmartInfo(const char *Cmd){
                if (!silent) PrintAndLogEx(WARNING, "smart card select failed");
                return 1;
        }
                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 ---------");
 
        // print header
        PrintAndLogEx(INFO, "--- Smartcard Information ---------");
Impressum, Datenschutz