]> cvs.zerfleddert.de Git - proxmark3-svn/commitdiff
Removed unneeded verbosity and checked for a 0x00 response from PICC after challenge...
authorBlaine Forbort <b.forbort@gmail.com>
Sat, 20 Dec 2014 04:38:25 +0000 (20:38 -0800)
committerBlaine Forbort <b.forbort@gmail.com>
Sat, 20 Dec 2014 04:38:25 +0000 (20:38 -0800)
armsrc/mifaredesfire.c

index c56d8bc069d5920c02f1350e3e039e728bcdb3cc..66fe00bddf0fa52e1df3b7e273669d36fa082f4e 100644 (file)
@@ -239,16 +239,12 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno,  uint8_t *datain
             memcpy( encRndB, resp+3, 8);
             
             des_dec(&decRndB, &encRndB, &keybytes);
-            Dbprintf("RndB: %02x%02x%02x%02x%02x%02x%02x%02x",decRndB[0],decRndB[1],decRndB[2],decRndB[3],decRndB[4],decRndB[5],decRndB[6],decRndB[7]);
             rol(decRndB,8);
-            Dbprintf("RndB': %02x%02x%02x%02x%02x%02x%02x%02x",decRndB[0],decRndB[1],decRndB[2],decRndB[3],decRndB[4],decRndB[5],decRndB[6],decRndB[7]);
             
             uint8_t decRndA[8] = {0x00};
             uint8_t encRndA[8] = {0x00};
             
             des_dec(&encRndA, &decRndA, &keybytes);
-            Dbprintf("RndA: %02x%02x%02x%02x%02x%02x%02x%02x",decRndA[0],decRndA[1],decRndA[2],decRndA[3],decRndA[4],decRndA[5],decRndA[6],decRndA[7]);
-            Dbprintf("ek0RandA: %02x%02x%02x%02x%02x%02x%02x%02x",encRndA[0],encRndA[1],encRndA[2],encRndA[3],encRndA[4],encRndA[5],encRndA[6],encRndA[7]);
             
             memcpy(both, encRndA, 8);
             
@@ -260,7 +256,6 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno,  uint8_t *datain
             des_dec(&encRndB, &decRndB, &keybytes);
             
             memcpy(both + 8, encRndB, 8);
-            Dbprintf("both: %02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x%02x",both[0],both[1],both[2],both[3],both[4],both[5],both[6],both[7],both[8],both[9],both[10],both[11],both[12],both[13],both[14],both[15]);
             
             cmd[0] = ADDITIONAL_FRAME;
             memcpy(cmd+1, both, 16 );
@@ -274,7 +269,15 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno,  uint8_t *datain
                 return;
             }
             
-            // TODO: Check returned RandA'
+            if ( resp[2] == 0x00 ){
+                // TODO: Create session key.
+            } else {
+                DbpString("Authetication failed.");
+                OnError();
+                return;
+            }
+            
+                // TOD: Optionally, confirm ek0RndA' = RndA' to varify PICC
             
             }
                        break;
Impressum, Datenschutz