mirror of
https://github.com/DarkFlippers/unleashed-firmware
synced 2025-02-16 21:38:39 +00:00
NFC: Fix washcity plugin verify function being to greedy (#3467)
* NFC: Fix washcity plugin verify function being to greedy It verifies only a single sector and that one using one of the commonly used key 0xA0A1A2A3A4A5 This leads to false-positives and the dicts not being used at all * nfc app: washcity plugin: fix verify function Co-authored-by: gornekich <n.gorbadey@gmail.com> Co-authored-by: あく <alleteam@gmail.com>
This commit is contained in:
parent
1070064f89
commit
7b26dc5ebf
1 changed files with 7 additions and 7 deletions
|
@ -57,20 +57,20 @@ static bool washcity_verify(Nfc* nfc) {
|
|||
bool verified = false;
|
||||
|
||||
do {
|
||||
const uint8_t ticket_sector_number = 0;
|
||||
const uint8_t ticket_block_number =
|
||||
mf_classic_get_first_block_num_of_sector(ticket_sector_number) + 1;
|
||||
FURI_LOG_D(TAG, "Verifying sector %u", ticket_sector_number);
|
||||
const uint8_t verify_sector_number = 1;
|
||||
const uint8_t verify_block_number =
|
||||
mf_classic_get_first_block_num_of_sector(verify_sector_number);
|
||||
FURI_LOG_D(TAG, "Verifying sector %u", verify_sector_number);
|
||||
|
||||
MfClassicKey key = {0};
|
||||
bit_lib_num_to_bytes_be(
|
||||
washcity_1k_keys[ticket_sector_number].a, COUNT_OF(key.data), key.data);
|
||||
washcity_1k_keys[verify_sector_number].a, COUNT_OF(key.data), key.data);
|
||||
|
||||
MfClassicAuthContext auth_context;
|
||||
MfClassicError error = mf_classic_poller_sync_auth(
|
||||
nfc, ticket_block_number, &key, MfClassicKeyTypeA, &auth_context);
|
||||
nfc, verify_block_number, &key, MfClassicKeyTypeA, &auth_context);
|
||||
if(error != MfClassicErrorNone) {
|
||||
FURI_LOG_D(TAG, "Failed to read block %u: %d", ticket_block_number, error);
|
||||
FURI_LOG_D(TAG, "Failed to read block %u: %d", verify_block_number, error);
|
||||
break;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue