mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-05 07:36:14 +08:00
Accept key number from command line
This commit is contained in:
parent
a07a448220
commit
6534821365
1 changed files with 9 additions and 2 deletions
|
@ -226,7 +226,7 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno, uint8_t *datain
|
|||
}
|
||||
|
||||
cmd[0] = AUTHENTICATE;
|
||||
cmd[1] = 0x00; //keynumber
|
||||
cmd[1] = keyno; //keynumber
|
||||
len = DesfireAPDU(cmd, 2, resp);
|
||||
if ( !len ) {
|
||||
if (MF_DBGLEVEL >= 1) {
|
||||
|
@ -236,6 +236,13 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno, uint8_t *datain
|
|||
return;
|
||||
}
|
||||
|
||||
if ( resp[2] == 0xaf ){
|
||||
} else {
|
||||
DbpString("Authetication failed. Invalid key number.");
|
||||
OnError();
|
||||
return;
|
||||
}
|
||||
|
||||
memcpy( encRndB, resp+3, 8);
|
||||
|
||||
des_dec(&decRndB, &encRndB, &keybytes);
|
||||
|
@ -277,7 +284,7 @@ void MifareDES_Auth1(uint8_t mode, uint8_t algo, uint8_t keyno, uint8_t *datain
|
|||
return;
|
||||
}
|
||||
|
||||
// TOD: Optionally, confirm ek0RndA' = RndA' to varify PICC
|
||||
// TODO: Optionally, confirm ek0RndA' = RndA' to varify PICC
|
||||
|
||||
}
|
||||
break;
|
||||
|
|
Loading…
Reference in a new issue