mirror of
https://github.com/DarkFlippers/unleashed-firmware.git
synced 2025-12-12 12:42:30 +04: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:
@@ -57,20 +57,20 @@ static bool washcity_verify(Nfc* nfc) {
|
|||||||
bool verified = false;
|
bool verified = false;
|
||||||
|
|
||||||
do {
|
do {
|
||||||
const uint8_t ticket_sector_number = 0;
|
const uint8_t verify_sector_number = 1;
|
||||||
const uint8_t ticket_block_number =
|
const uint8_t verify_block_number =
|
||||||
mf_classic_get_first_block_num_of_sector(ticket_sector_number) + 1;
|
mf_classic_get_first_block_num_of_sector(verify_sector_number);
|
||||||
FURI_LOG_D(TAG, "Verifying sector %u", ticket_sector_number);
|
FURI_LOG_D(TAG, "Verifying sector %u", verify_sector_number);
|
||||||
|
|
||||||
MfClassicKey key = {0};
|
MfClassicKey key = {0};
|
||||||
bit_lib_num_to_bytes_be(
|
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;
|
MfClassicAuthContext auth_context;
|
||||||
MfClassicError error = mf_classic_poller_sync_auth(
|
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) {
|
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;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user