diff --git a/applications/main/nfc/plugins/supported_cards/emv.c b/applications/main/nfc/plugins/supported_cards/emv.c index 30296e098..63bc534c9 100644 --- a/applications/main/nfc/plugins/supported_cards/emv.c +++ b/applications/main/nfc/plugins/supported_cards/emv.c @@ -73,8 +73,10 @@ static bool emv_parse(const NfcDevice* device, FuriString* parsed_data) { const EmvApplication app = data->emv_application; do { - if(strlen(app.payment_sys)) - furi_string_cat_printf(parsed_data, "\e#%s\n", app.payment_sys); + if(strlen(app.label)) + furi_string_cat_printf(parsed_data, "\e#%s\n", app.label); + else if(strlen(app.name)) + furi_string_cat_printf(parsed_data, "\e#%s\n", app.name); else furi_string_cat_printf(parsed_data, "\e#%s\n", "EMV"); @@ -93,8 +95,6 @@ static bool emv_parse(const NfcDevice* device, FuriString* parsed_data) { furi_string_free(pan); } - if(strlen(app.name)) furi_string_cat_printf(parsed_data, "Name: %s\n", app.name); - if(app.effective_month) { char day[] = "??"; if(app.effective_day) itoa(app.effective_day, day, 16); diff --git a/lib/nfc/protocols/emv/emv.c b/lib/nfc/protocols/emv/emv.c index 0dabd3690..89d490c90 100644 --- a/lib/nfc/protocols/emv/emv.c +++ b/lib/nfc/protocols/emv/emv.c @@ -76,12 +76,12 @@ bool emv_load(EmvData* data, FlipperFormat* ff, uint32_t version) { EmvApplication* app = &data->emv_application; - if(!flipper_format_read_string(ff, "Name", temp_str)) break; + flipper_format_read_string(ff, "Application name", temp_str); strcpy(app->name, furi_string_get_cstr(temp_str)); //Read label - if(!flipper_format_read_string(ff, "Payment system", temp_str)) break; - strcpy(app->payment_sys, furi_string_get_cstr(temp_str)); + flipper_format_read_string(ff, "Application label", temp_str); + strcpy(app->label, furi_string_get_cstr(temp_str)); uint32_t pan_len; if(!flipper_format_read_uint32(ff, "PAN length", &pan_len, 1)) break; @@ -131,9 +131,9 @@ bool emv_save(const EmvData* data, FlipperFormat* ff) { if(!flipper_format_write_comment_cstr(ff, "EMV specific data:\n")) break; - if(!flipper_format_write_string_cstr(ff, "Name", app.name)) break; + if(!flipper_format_write_string_cstr(ff, "Application name", app.name)) break; - if(!flipper_format_write_string_cstr(ff, "Payment system", app.payment_sys)) break; + if(!flipper_format_write_string_cstr(ff, "Application label", app.label)) break; uint32_t pan_len = app.pan_len; if(!flipper_format_write_uint32(ff, "PAN length", &pan_len, 1)) break; diff --git a/lib/nfc/protocols/emv/emv.h b/lib/nfc/protocols/emv/emv.h index 88ea4a9d8..f61fe1610 100644 --- a/lib/nfc/protocols/emv/emv.h +++ b/lib/nfc/protocols/emv/emv.h @@ -13,7 +13,7 @@ extern "C" { #define EMV_TAG_AID 0x4F #define EMV_TAG_PRIORITY 0x87 #define EMV_TAG_PDOL 0x9F38 -#define EMV_TAG_APPL_PAYMENT_SYS 0x50 +#define EMV_TAG_APPL_LABEL 0x50 #define EMV_TAG_APPL_NAME 0x9F12 #define EMV_TAG_APPL_EFFECTIVE 0x5F25 #define EMV_TAG_PIN_ATTEMPTS_COUNTER 0x9F17 @@ -79,7 +79,7 @@ typedef struct { uint8_t aid[16]; uint8_t aid_len; char name[16 + 1]; - char payment_sys[16 + 1]; + char label[16 + 1]; uint8_t pan[10]; // card_number uint8_t pan_len; uint8_t exp_day; diff --git a/lib/nfc/protocols/emv/emv_poller_i.c b/lib/nfc/protocols/emv/emv_poller_i.c index 81b91c553..a03681a7c 100644 --- a/lib/nfc/protocols/emv/emv_poller_i.c +++ b/lib/nfc/protocols/emv/emv_poller_i.c @@ -115,11 +115,11 @@ static bool success = true; FURI_LOG_T(TAG, "found EMV_TAG_APP_PRIORITY %X: %d", tag, app->priority); break; - case EMV_TAG_APPL_PAYMENT_SYS: - memcpy(app->payment_sys, &buff[i], tlen); - app->payment_sys[tlen] = '\0'; + case EMV_TAG_APPL_LABEL: + memcpy(app->label, &buff[i], tlen); + app->label[tlen] = '\0'; success = true; - FURI_LOG_T(TAG, "found EMV_TAG_APPL_PAYMENT_SYS %x: %s", tag, app->payment_sys); + FURI_LOG_T(TAG, "found EMV_TAG_APPL_LABEL %x: %s", tag, app->label); break; case EMV_TAG_APPL_NAME: furi_check(tlen < sizeof(app->name));