From 6e73038157b1263ac224e3e1e88f913d263861b6 Mon Sep 17 00:00:00 2001 From: kormax <3392860+kormax@users.noreply.github.com> Date: Sun, 5 Apr 2026 10:50:28 +0300 Subject: [PATCH] Guard against EV2, remove LRP, EV2 channel suggestions --- client/src/cmdhfmfdes.c | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index ace415443..3df50917d 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -3555,7 +3555,7 @@ static int CmdHF14ADesCreateDelegateApp(const char *Cmd) { arg_str0("i", "kdfi", "", "KDF input (1-31 hex bytes)"), arg_str0("m", "cmode", "", "Communicaton mode"), arg_str0("c", "ccset", "", "Communicaton command set"), - arg_str0(NULL, "schann", "", "Secure channel"), + arg_str0(NULL, "schann", "", "Secure channel"), arg_str0(NULL, "aid", "", "Application ID for create. Mandatory in structured mode. (3 hex bytes, big endian)"), arg_str0(NULL, "damslot", "", "DAM slot number (2 hex bytes, little endian on card)"), arg_str0(NULL, "damslotver", "", "DAM slot version (1 hex byte, def: 00)"), @@ -3683,6 +3683,13 @@ static int CmdHF14ADesCreateDelegateApp(const char *Cmd) { uint8_t contdata[250] = {0}; size_t contdatalen = 0; + // Fixing EV2 mac calculation requires changes in multiple places (command chaining, counter increment modification, etc.) + // and is not worth the effort at the moment, so we just block it for now. + if (securechann == DACEV2) { + PrintAndLogEx(ERR, "CreateDelegatedApplication is not currently implemented for EV2 secure channel (EV2 MAC calculation issues)"); + return PM3_EINVARG; + } + if (appid == 0x000000) { PrintAndLogEx(ERR, "Creating the root aid (0x000000) is " _RED_("forbidden")); return PM3_ESOFT;