fix false-positive emv protocol detect

This commit is contained in:
Methodius 2024-02-14 17:41:45 +09:00
parent 3f29295380
commit 0397dd0a40
No known key found for this signature in database
GPG key ID: 122FA99A00B41679
3 changed files with 3 additions and 6 deletions

View file

@ -66,11 +66,6 @@ void nfc_render_emv_country(uint16_t country_code, FuriString* str) {
void nfc_render_emv_application(const EmvApplication* apl, FuriString* str) {
const uint8_t len = apl->aid_len;
if(!len) {
furi_string_cat_printf(str, "No Pay Application found\n");
return;
}
furi_string_cat_printf(str, "AID: ");
for(uint8_t i = 0; i < len; i++) furi_string_cat_printf(str, "%02X", apl->aid[i]);
furi_string_cat_printf(str, "\n");

View file

@ -10,6 +10,8 @@ extern "C" {
#define EMV_REQ_GET_DATA 0x80CA
#define UNKNOWN_TAG 0x0B
#define EMV_TAG_AID 0x4F
#define EMV_TAG_PRIORITY 0x87
#define EMV_TAG_APPL_INTERCHANGE_PROFILE 0x82

View file

@ -186,7 +186,7 @@ static bool emv_poller_detect(NfcGenericEvent event, void* context) {
if(iso14443_4a_event->type == Iso14443_4aPollerEventTypeReady) {
const EmvError error = emv_poller_select_ppse(instance);
protocol_detected = (error == EmvErrorNone);
protocol_detected = (error == EmvErrorNone) && (instance->data->emv_application.aid_len);
}
return protocol_detected;