From 7b26dc5ebfaa9d137e9d1764f95ee3738ee75a01 Mon Sep 17 00:00:00 2001 From: philicious Date: Tue, 5 Mar 2024 03:42:39 +0100 Subject: [PATCH] NFC: Fix washcity plugin verify function being to greedy (#3467) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * 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 Co-authored-by: あく --- .../main/nfc/plugins/supported_cards/washcity.c | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/applications/main/nfc/plugins/supported_cards/washcity.c b/applications/main/nfc/plugins/supported_cards/washcity.c index 2c0ec094c..179b569d7 100644 --- a/applications/main/nfc/plugins/supported_cards/washcity.c +++ b/applications/main/nfc/plugins/supported_cards/washcity.c @@ -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; }