From 0944ec1fee031d61ba98add1cadc4a6f62550642 Mon Sep 17 00:00:00 2001 From: merlokk <807634+merlokk@users.noreply.github.com> Date: Mon, 10 May 2021 15:02:23 +0300 Subject: [PATCH] fix plain parameter (now dirty) --- client/src/cmdhffido.c | 14 ++++++++------ 1 file changed, 8 insertions(+), 6 deletions(-) diff --git a/client/src/cmdhffido.c b/client/src/cmdhffido.c index 5bf80a4cb..02eaab348 100644 --- a/client/src/cmdhffido.c +++ b/client/src/cmdhffido.c @@ -130,8 +130,8 @@ static int CmdHFFidoRegister(const char *cmd) { "The output template filename is `hf-fido2-params.json`\n" "\n", "hf fido reg -> execute command with 2 parameters, filled 0x00\n" - "hf fido reg -p s0 s1 -> execute command with plain parameters\n" - "hf fido reg --cp 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f --ap 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f\n" + "hf fido reg -p --cp s0 --ap s1 -> execute command with plain parameters\n" + "hf fido reg --cpx 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f --apx 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f\n" ); void *argtable[] = { @@ -141,8 +141,10 @@ static int CmdHFFidoRegister(const char *cmd) { arg_lit0("p", "plain", "send plain ASCII to challenge and application parameters instead of HEX"), arg_lit0("t", "tlv", "Show DER certificate contents in TLV representation"), arg_str0("f", "file", "", "JSON input file name for parameters"), - arg_str0(NULL, "cp", "", "challenge parameter (32 bytes hex / 1..16 chars)"), - arg_str0(NULL, "ap", "", "application parameter (32 bytes hex / 1..16 chars)"), + arg_str0(NULL, "cp", "", "challenge parameter (1..16 chars)"), + arg_str0(NULL, "ap", "", "application parameter (1..16 chars)"), + arg_str0(NULL, "cpx", "", "challenge parameter (32 bytes hex)"), + arg_str0(NULL, "apx", "", "application parameter (32 bytes hex)"), arg_param_end }; CLIExecWithReturn(ctx, cmd, argtable, true); @@ -200,7 +202,7 @@ static int CmdHFFidoRegister(const char *cmd) { } } else { chlen = sizeof(cdata); - CLIGetHexWithReturn(ctx, 6, cdata, &chlen); + CLIGetHexWithReturn(ctx, 8, cdata, &chlen); if (chlen && chlen != 32) { PrintAndLogEx(ERR, "ERROR: challenge parameter length must be 32 bytes only."); CLIParserFree(ctx); @@ -224,7 +226,7 @@ static int CmdHFFidoRegister(const char *cmd) { } } else { applen = sizeof(adata); - CLIGetHexWithReturn(ctx, 7, adata, &applen); + CLIGetHexWithReturn(ctx, 9, adata, &applen); if (applen && applen != 32) { PrintAndLogEx(ERR, "ERROR: application parameter length must be 32 bytes only."); CLIParserFree(ctx);