]> cvs.zerfleddert.de Git - proxmark3-svn/blobdiff - client/cmdhflist.c
Merge pull request #580 from Proxmark/iceman1001-patch-1
[proxmark3-svn] / client / cmdhflist.c
index bbfb24c89da4209292ff6482251250debcbdb95d..cf69abbaacf3b52ea965300d98783899c4fa3856 100644 (file)
@@ -325,11 +325,12 @@ void annotateMifare(char *exp, size_t size, uint8_t* cmd, uint8_t cmdsize, uint8
                        if (cmdsize == 4 && isResponse) {
                                snprintf(exp,size,"AUTH: nt %s", (AuthData.first_auth) ? "" : "(enc)");
                                MifareAuthState = masNrAr;
                        if (cmdsize == 4 && isResponse) {
                                snprintf(exp,size,"AUTH: nt %s", (AuthData.first_auth) ? "" : "(enc)");
                                MifareAuthState = masNrAr;
-                               if (AuthData.first_auth)
+                               if (AuthData.first_auth) {
                                        AuthData.nt = bytes_to_num(cmd, 4);
                                        AuthData.nt = bytes_to_num(cmd, 4);
-                               else
+                               } else {
                                        AuthData.nt_enc = bytes_to_num(cmd, 4);
                                        AuthData.nt_enc_par = parity[0];
                                        AuthData.nt_enc = bytes_to_num(cmd, 4);
                                        AuthData.nt_enc_par = parity[0];
+                               }
                                return;
                        } else {
                                MifareAuthState = masError;
                                return;
                        } else {
                                MifareAuthState = masError;
@@ -392,7 +393,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes
                        AuthData.ks3 = AuthData.at_enc ^ prng_successor(AuthData.nt, 96);
 
                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
                        AuthData.ks3 = AuthData.at_enc ^ prng_successor(AuthData.nt, 96);
 
                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
-                       PrintAndLog("            |          * | key | probable key:%010"PRIx64" Prng:%s   ks2:%08x ks3:%08x |     |", 
+                       PrintAndLog("            |          * | key | probable key:%012"PRIx64" Prng:%s   ks2:%08x ks3:%08x |     |", 
                                mfLastKey,
                                validate_prng_nonce(AuthData.nt) ? "WEAK": "HARD",
                                AuthData.ks2,
                                mfLastKey,
                                validate_prng_nonce(AuthData.nt) ? "WEAK": "HARD",
                                AuthData.ks2,
@@ -410,7 +411,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes
                        // check last used key
                        if (mfLastKey) {
                                if (NestedCheckKey(mfLastKey, &AuthData, cmd, cmdsize, parity)) {
                        // check last used key
                        if (mfLastKey) {
                                if (NestedCheckKey(mfLastKey, &AuthData, cmd, cmdsize, parity)) {
-                                       PrintAndLog("            |          * | key | last used key:%010"PRIx64"            ks2:%08x ks3:%08x |     |", 
+                                       PrintAndLog("            |          * | key | last used key:%012"PRIx64"            ks2:%08x ks3:%08x |     |", 
                                                mfLastKey,
                                                AuthData.ks2,
                                                AuthData.ks3);
                                                mfLastKey,
                                                AuthData.ks2,
                                                AuthData.ks3);
@@ -423,7 +424,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes
                        if (!traceCrypto1) {
                                for (int defaultKeyCounter = 0; defaultKeyCounter < MifareDefaultKeysSize; defaultKeyCounter++){
                                        if (NestedCheckKey(MifareDefaultKeys[defaultKeyCounter], &AuthData, cmd, cmdsize, parity)) {
                        if (!traceCrypto1) {
                                for (int defaultKeyCounter = 0; defaultKeyCounter < MifareDefaultKeysSize; defaultKeyCounter++){
                                        if (NestedCheckKey(MifareDefaultKeys[defaultKeyCounter], &AuthData, cmd, cmdsize, parity)) {
-                                               PrintAndLog("            |          * | key | default key:%010"PRIx64"              ks2:%08x ks3:%08x |     |", 
+                                               PrintAndLog("            |          * | key | default key:%012"PRIx64"              ks2:%08x ks3:%08x |     |", 
                                                        MifareDefaultKeys[defaultKeyCounter],
                                                        AuthData.ks2,
                                                        AuthData.ks3);
                                                        MifareDefaultKeys[defaultKeyCounter],
                                                        AuthData.ks2,
                                                        AuthData.ks3);
@@ -455,7 +456,7 @@ bool DecodeMifareData(uint8_t *cmd, uint8_t cmdsize, uint8_t *parity, bool isRes
 
                                                        AuthData.nt = ntx;
                                                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
 
                                                        AuthData.nt = ntx;
                                                        mfLastKey = GetCrypto1ProbableKey(&AuthData);
-                                                       PrintAndLog("            |          * | key | nested probable key:%010"PRIx64"      ks2:%08x ks3:%08x |     |", 
+                                                       PrintAndLog("            |          * | key | nested probable key:%012"PRIx64"      ks2:%08x ks3:%08x |     |", 
                                                                mfLastKey,
                                                                AuthData.ks2,
                                                                AuthData.ks3);
                                                                mfLastKey,
                                                                AuthData.ks2,
                                                                AuthData.ks3);
Impressum, Datenschutz