From fcce8f745c630219c5a85996cf204f9d6faf3241 Mon Sep 17 00:00:00 2001 From: Andrea Sacchi Date: Thu, 22 Sep 2022 15:11:54 +0200 Subject: [PATCH] Fix Mifare Classic key str to int conversion Wrong cast lead to unexpected behavior converting key from str to int. --- lib/nfc/helpers/mf_classic_dict.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/nfc/helpers/mf_classic_dict.c b/lib/nfc/helpers/mf_classic_dict.c index a615e7899..23e68a80a 100644 --- a/lib/nfc/helpers/mf_classic_dict.c +++ b/lib/nfc/helpers/mf_classic_dict.c @@ -100,7 +100,7 @@ static void mf_classic_dict_str_to_int(string_t key_str, uint64_t* key_int) { for(uint8_t i = 0; i < 12; i += 2) { args_char_to_hex( string_get_char(key_str, i), string_get_char(key_str, i + 1), &key_byte_tmp); - *key_int |= (uint8_t)key_byte_tmp << 8 * (5 - i / 2); + *key_int |= (uint64_t)key_byte_tmp << 8 * (5 - i / 2); } }