From 5d28939c287552b1f4aa44b375ab3f75667b6853 Mon Sep 17 00:00:00 2001 From: Methodius Date: Thu, 7 Dec 2023 21:59:27 +0900 Subject: [PATCH] social_moscow parser verification collisions fix --- .../main/nfc/plugins/supported_cards/social_moscow.c | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/applications/main/nfc/plugins/supported_cards/social_moscow.c b/applications/main/nfc/plugins/supported_cards/social_moscow.c index ca52661b2..834ade02e 100644 --- a/applications/main/nfc/plugins/supported_cards/social_moscow.c +++ b/applications/main/nfc/plugins/supported_cards/social_moscow.c @@ -671,7 +671,7 @@ bool parse_transport_block(const MfClassicBlock* block, FuriString* result) { FuriHalRtcDateTime card_start_trip_minutes_s = {0}; from_minutes_to_datetime( - (card_start_trip_date) * 24 * 60 + card_start_trip_time, + (card_start_trip_date)*24 * 60 + card_start_trip_time, &card_start_trip_minutes_s, 1992); furi_string_printf( @@ -1565,8 +1565,11 @@ static bool social_moscow_parse(const NfcDevice* device, FuriString* parsed_data const MfClassicSectorTrailer* sec_tr = mf_classic_get_sector_trailer_by_sector(data, cfg.data_sector); - const uint64_t key = nfc_util_bytes2num(sec_tr->key_a.data, COUNT_OF(sec_tr->key_a.data)); - if(key != cfg.keys[cfg.data_sector].a) break; + const uint64_t key_a = + nfc_util_bytes2num(sec_tr->key_a.data, COUNT_OF(sec_tr->key_a.data)); + const uint64_t key_b = + nfc_util_bytes2num(sec_tr->key_b.data, COUNT_OF(sec_tr->key_b.data)); + if((key_a != cfg.keys[cfg.data_sector].a) || (key_b != cfg.keys[cfg.data_sector].b)) break; uint32_t card_code = bit_lib_get_bits_32(data->block[60].data, 8, 24); uint8_t card_region = bit_lib_get_bits(data->block[60].data, 32, 8);