}
cmd[0] = AUTHENTICATE;
- cmd[1] = 0x00; //keynumber
+ cmd[1] = keyno; //keynumber
len = DesfireAPDU(cmd, 2, resp);
if ( !len ) {
if (MF_DBGLEVEL >= 1) {
return;
}
+ if ( resp[2] == 0xaf ){
+ } else {
+ DbpString("Authetication failed. Invalid key number.");
+ OnError();
+ return;
+ }
+
memcpy( encRndB, resp+3, 8);
des_dec(&decRndB, &encRndB, &keybytes);
return;
}
- // TOD: Optionally, confirm ek0RndA' = RndA' to varify PICC
+ // TODO: Optionally, confirm ek0RndA' = RndA' to varify PICC
}
break;