From cbb484588ce8ac79cce1499e9d1561ef778a3381 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 15 Jun 2021 15:36:50 +0300 Subject: [PATCH 1/4] add some info --- client/src/cipurse/cipursecore.c | 35 ++++++++++++++++++++++++++++++++ 1 file changed, 35 insertions(+) diff --git a/client/src/cipurse/cipursecore.c b/client/src/cipurse/cipursecore.c index 9a6c13563..2b5f52088 100644 --- a/client/src/cipurse/cipursecore.c +++ b/client/src/cipurse/cipursecore.c @@ -211,6 +211,32 @@ void CIPURSECSetActChannelSecurityLevels(CipurseChannelSecurityLevel req, Cipurs CipurseCChannelSetSecurityLevels(&cipurseContext, req, resp); } +static void CIPURSEPrintPersoMode(uint8_t data) { + if (data & 0x01) + PrintAndLogEx(INFO, "Perso: filesystem"); + if (data & 0x02) + PrintAndLogEx(INFO, "Perso: EMV"); + if (data & 0x04) + PrintAndLogEx(INFO, "Perso: transaction supported"); + +} + +static void CIPURSEPrintProfileInfo(uint8_t data) { + if (data & 0x01) + PrintAndLogEx(INFO, "Profile: L"); + if (data & 0x02) + PrintAndLogEx(INFO, "Profile: S"); + if (data & 0x04) + PrintAndLogEx(INFO, "Profile: T"); +} + +static void CIPURSEPrintManufacturerInfo(uint8_t data) { + if (data == 0) + PrintAndLogEx(INFO, "Manufacturer: n/a"); + else + PrintAndLogEx(INFO, "Manufacturer: %s", getTagInfo(data)); // getTagInfo from cmfhf14a.h +} + void CIPURSEPrintInfoFile(uint8_t *data, size_t len) { if (len < 2) { PrintAndLogEx(ERR, "Info file length " _RED_("ERROR")); @@ -219,6 +245,15 @@ void CIPURSEPrintInfoFile(uint8_t *data, size_t len) { PrintAndLogEx(INFO, "------------ INFO ------------"); PrintAndLogEx(INFO, "CIPURSE version %d revision %d", data[0], data[1]); + + if (len >= 3) + CIPURSEPrintPersoMode(data[2]); + + if (len >= 4) + CIPURSEPrintProfileInfo(data[3]); + + if (len >= 9) + CIPURSEPrintManufacturerInfo(data[8]); } static void CIPURSEPrintFileDescriptor(uint8_t desc) { From c8c3c279ebe6579abea9706f3ccb1fc635e5a2b6 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 15 Jun 2021 15:44:04 +0300 Subject: [PATCH 2/4] small fix --- client/src/cipurse/cipursecore.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/client/src/cipurse/cipursecore.c b/client/src/cipurse/cipursecore.c index 2b5f52088..70d2b51d3 100644 --- a/client/src/cipurse/cipursecore.c +++ b/client/src/cipurse/cipursecore.c @@ -148,7 +148,7 @@ int CIPURSEReadBinary(uint16_t offset, uint8_t *Result, size_t MaxResultLen, siz } int CIPURSEUpdateBinary(uint16_t offset, uint8_t *data, uint16_t datalen, uint8_t *Result, size_t MaxResultLen, size_t *ResultLen, uint16_t *sw) { - return CIPURSEExchangeEx(false, true, (sAPDU) {0x00, 0xd6, (offset >> 8) & 0x7f, offset & 0xff, datalen, data}, true, 0, Result, MaxResultLen, ResultLen, sw); + return CIPURSEExchange((sAPDU) {0x00, 0xd6, (offset >> 8) & 0x7f, offset & 0xff, datalen, data}, Result, MaxResultLen, ResultLen, sw); } bool CIPURSEChannelAuthenticate(uint8_t keyIndex, uint8_t *key, bool verbose) { From 711361b4be2a79f4d40f8ef64fb7d4e385772c39 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:33:21 +0300 Subject: [PATCH 3/4] changelog --- CHANGELOG.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/CHANGELOG.md b/CHANGELOG.md index 5e09e96b1..52f81308b 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,6 +3,8 @@ 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 fido` commands (@merlokk) + - Added `hf cipurse` commands to wirk with cipurse transport cards (@merlokk) - Added '--gap' option to lf em 410x sim for more control over sim data (@mwalker) - Changed `hf fido` - refactored load/save json objects (@iceman1001) - Moved / renamed `fido2.json` -> `client/resource/fido2_defparams.json` (@iceman1001) From 4661a62d077cf3830aef9966e5856ad3af5ca191 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Tue, 15 Jun 2021 17:43:14 +0300 Subject: [PATCH 4/4] changelog --- CHANGELOG.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 52f81308b..4395946e9 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -3,8 +3,9 @@ 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 fido` commands (@merlokk) - - Added `hf cipurse` commands to wirk with cipurse transport cards (@merlokk) + - Fixed `hf fido` commands now works correctly (@merlokk) + - Moved / renamed `client/resource/fido2_defparams.json` -> `client/resource/hf_fido2_defparams.json` (@merlokk) + - Added `hf cipurse` commands to work with cipurse transport cards (@merlokk) - Added '--gap' option to lf em 410x sim for more control over sim data (@mwalker) - Changed `hf fido` - refactored load/save json objects (@iceman1001) - Moved / renamed `fido2.json` -> `client/resource/fido2_defparams.json` (@iceman1001)