From be43e498698d623d6e9ddbcb36760a049b331038 Mon Sep 17 00:00:00 2001 From: gornekich Date: Thu, 18 Apr 2024 01:56:39 +0100 Subject: [PATCH] nfc app: fix false positive verification in bip plugin (#3595) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-authored-by: あく --- applications/main/nfc/plugins/supported_cards/bip.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/applications/main/nfc/plugins/supported_cards/bip.c b/applications/main/nfc/plugins/supported_cards/bip.c index 548afed71f..8b76c2d075 100644 --- a/applications/main/nfc/plugins/supported_cards/bip.c +++ b/applications/main/nfc/plugins/supported_cards/bip.c @@ -61,7 +61,7 @@ bool bip_verify(Nfc* nfc) { MfClassicError error = mf_classic_poller_sync_auth(nfc, block_num, &key_a_0, MfClassicKeyTypeA, &auth_ctx); - if(error == MfClassicErrorNotPresent) { + if(error != MfClassicErrorNone) { FURI_LOG_D(TAG, "Failed to read block %u: %d", block_num, error); verified = false; } @@ -81,7 +81,8 @@ static bool bip_read(Nfc* nfc, NfcDevice* device) { do { MfClassicType type = MfClassicType1k; MfClassicError error = mf_classic_poller_sync_detect_type(nfc, &type); - if(error == MfClassicErrorNotPresent) { + if(error != MfClassicErrorNone) break; + if(type != MfClassicType1k) { FURI_LOG_W(TAG, "Card not MIFARE Classic 1k"); break; }