mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-14 10:37:23 -07:00
hf mf nested: break bad loop if timeout (@uzlonewolf)
This commit is contained in:
parent
64d08de6a6
commit
bd70689de2
2 changed files with 12 additions and 3 deletions
|
@ -32,6 +32,7 @@
|
|||
#include "crc16.h"
|
||||
#include "dbprint.h"
|
||||
#include "ticks.h"
|
||||
#include "usb_cdc.h" // usb_poll_validate_length
|
||||
|
||||
#ifndef HARDNESTED_AUTHENTICATION_TIMEOUT
|
||||
# define HARDNESTED_AUTHENTICATION_TIMEOUT 848 // card times out 1ms after wrong authentication (according to NXP documentation)
|
||||
|
@ -918,7 +919,7 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
|||
for (rtr = 0; rtr < 17; rtr++) {
|
||||
|
||||
// Test if the action was cancelled
|
||||
if (BUTTON_PRESS()) {
|
||||
if (BUTTON_PRESS() || usb_poll_validate_length()) {
|
||||
isOK = -2;
|
||||
break;
|
||||
}
|
||||
|
@ -998,6 +999,12 @@ void MifareNested(uint8_t blockNo, uint8_t keyType, uint8_t targetBlockNo, uint8
|
|||
target_nt[i] = 0;
|
||||
while (target_nt[i] == 0) { // continue until we have an unambiguous nonce
|
||||
|
||||
// Test if the action was cancelled
|
||||
if (BUTTON_PRESS() || usb_poll_validate_length()) {
|
||||
isOK = -2;
|
||||
break;
|
||||
}
|
||||
|
||||
// prepare next select. No need to power down the card.
|
||||
if (mifare_classic_halt(pcs, cuid)) {
|
||||
if (DBGLEVEL >= DBG_INFO) Dbprintf("Nested: Halt error");
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue