From 87266654f7a1731c8ea8445549f0d6387c0af4d3 Mon Sep 17 00:00:00 2001 From: Philippe Teuwen Date: Wed, 4 Dec 2024 08:16:55 +0100 Subject: [PATCH] MIFARE Plus 4b UID: fix signature check --- CHANGELOG.md | 1 + client/src/cmdhfmfp.c | 8 +++++++- 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index f4553467a..86df97e12 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,7 @@ All notable changes to this project will be documented in this file. This project uses the changelog in accordance with [keepchangelog](http://keepachangelog.com/). Please use this to write notable changes, which is not the same as git commit log... ## [unreleased][unreleased] +- Fixed `hf mfp info` fix signature check on 4b UID cards (@doegox) - Automatically set maximum read/write block when using predefined types in `hf_mf_ultimatecard` script (@piotrva) - Changed SPI flash detection to calculate the size instead of table lookup, updated spi_flash_decode.py script with more ICs (@ANTodorov) - Fixed `hf/lf tune` segfault when called from script (@doegox) diff --git a/client/src/cmdhfmfp.c b/client/src/cmdhfmfp.c index 9d9ecb880..ab5ce8f46 100644 --- a/client/src/cmdhfmfp.c +++ b/client/src/cmdhfmfp.c @@ -333,10 +333,12 @@ static int CmdHFMFPInfo(const char *Cmd) { // version check uint8_t version[30] = {0}; + uint8_t uid7b[7] = {0}; int version_len = sizeof(version); if (get_plus_version(version, &version_len) == PM3_SUCCESS) { plus_print_version(version); supportVersion = true; + memcpy(uid7b, version + 14, 7); } else { // info about 14a part, historical bytes. infoHF14A(false, false, false); @@ -346,7 +348,11 @@ static int CmdHFMFPInfo(const char *Cmd) { uint8_t signature[56] = {0}; int signature_len = sizeof(signature); if (get_plus_signature(signature, &signature_len) == PM3_SUCCESS) { - plus_print_signature(card.uid, card.uidlen, signature, signature_len); + if (supportVersion) { + plus_print_signature(uid7b, 7, signature, signature_len); + } else { + plus_print_signature(card.uid, card.uidlen, signature, signature_len); + } supportSignature = true; }