Skip to content

Commit

Permalink
nfc app: fix false positive verification in bip plugin (#3595)
Browse files Browse the repository at this point in the history
Co-authored-by: あく <[email protected]>
  • Loading branch information
gornekich and skotopes authored Apr 18, 2024
1 parent 00970a4 commit be43e49
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions applications/main/nfc/plugins/supported_cards/bip.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand All @@ -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;
}
Expand Down

0 comments on commit be43e49

Please sign in to comment.