mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-21 05:43:48 -07:00
trace list -t mf: some info about nt
This commit is contained in:
parent
e7c4ae2b1e
commit
036fa47703
1 changed files with 6 additions and 1 deletions
|
@ -2063,14 +2063,19 @@ void annotateMifare(char *exp, size_t size, uint8_t *cmd, uint8_t cmdsize,
|
||||||
switch (MifareAuthState) {
|
switch (MifareAuthState) {
|
||||||
case masNt:
|
case masNt:
|
||||||
if (cmdsize == 4 && isResponse) {
|
if (cmdsize == 4 && isResponse) {
|
||||||
snprintf(exp, size, "AUTH: nt %s", (AuthData.first_auth) ? "" : "(enc)");
|
|
||||||
MifareAuthState = masNrAr;
|
MifareAuthState = masNrAr;
|
||||||
if (AuthData.first_auth) {
|
if (AuthData.first_auth) {
|
||||||
AuthData.nt = bytes_to_num(cmd, 4);
|
AuthData.nt = bytes_to_num(cmd, 4);
|
||||||
AuthData.nt_enc_par = 0;
|
AuthData.nt_enc_par = 0;
|
||||||
|
if (validate_prng_nonce(AuthData.nt)) {
|
||||||
|
snprintf(exp, size, "AUTH: nt (lfsr16 index %i)", nonce_distance(0x0100, AuthData.nt));
|
||||||
|
} else {
|
||||||
|
snprintf(exp, size, "AUTH: nt");
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
AuthData.nt_enc = bytes_to_num(cmd, 4);
|
AuthData.nt_enc = bytes_to_num(cmd, 4);
|
||||||
AuthData.nt_enc_par = parity[0] & 0xF0;
|
AuthData.nt_enc_par = parity[0] & 0xF0;
|
||||||
|
snprintf(exp, size, "AUTH: nt (enc)");
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue