MIFARE Plus 4b UID: fix signature check

This commit is contained in:
Philippe Teuwen 2024-12-04 08:16:55 +01:00
commit 87266654f7
2 changed files with 8 additions and 1 deletions

View file

@ -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... 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] ## [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) - 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) - 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) - Fixed `hf/lf tune` segfault when called from script (@doegox)

View file

@ -333,10 +333,12 @@ static int CmdHFMFPInfo(const char *Cmd) {
// version check // version check
uint8_t version[30] = {0}; uint8_t version[30] = {0};
uint8_t uid7b[7] = {0};
int version_len = sizeof(version); int version_len = sizeof(version);
if (get_plus_version(version, &version_len) == PM3_SUCCESS) { if (get_plus_version(version, &version_len) == PM3_SUCCESS) {
plus_print_version(version); plus_print_version(version);
supportVersion = true; supportVersion = true;
memcpy(uid7b, version + 14, 7);
} else { } else {
// info about 14a part, historical bytes. // info about 14a part, historical bytes.
infoHF14A(false, false, false); infoHF14A(false, false, false);
@ -346,7 +348,11 @@ static int CmdHFMFPInfo(const char *Cmd) {
uint8_t signature[56] = {0}; uint8_t signature[56] = {0};
int signature_len = sizeof(signature); int signature_len = sizeof(signature);
if (get_plus_signature(signature, &signature_len) == PM3_SUCCESS) { 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; supportSignature = true;
} }