diff --git a/client/src/cmdhffido.c b/client/src/cmdhffido.c index d3ea8e1cb..d0be26cfd 100644 --- a/client/src/cmdhffido.c +++ b/client/src/cmdhffido.c @@ -176,10 +176,12 @@ static int cmd_hf_fido_register(const char *cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf fido reg", - "Initiate a U2F token registration. Needs two 32-byte hash numbers. \nchallenge parameter (32b) and application parameter (32b).", - "hf fido reg -> execute command with 2 parameters, filled 0x00\n" - "hf fido reg 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with parameters\n" - "hf fido reg -p s0 s1 -> execute command with plain parameters"); + "Initiate a U2F token registration. Needs two 32-byte hash numbers.\n" + "challenge parameter (32b) and application parameter (32b).", + "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" + ); void *argtable[] = { arg_param_begin, @@ -188,8 +190,8 @@ static int cmd_hf_fido_register(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("j", "json", "fido.json", "JSON input / output file name for parameters."), - arg_str0(NULL, NULL, "", NULL), - arg_str0(NULL, NULL, "", NULL), + 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_param_end }; CLIExecWithReturn(ctx, cmd, argtable, true); @@ -418,10 +420,13 @@ static int cmd_hf_fido_authenticate(const char *cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf fido auth", - "Initiate a U2F token authentication. Needs key handle and two 32-byte hash numbers. \nkey handle(var 0..255), challenge parameter (32b) and application parameter (32b).", - "hf fido auth 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with 2 parameters, filled 0x00 and key handle\n" - "hf fido auth 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f " - "000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with parameters"); + "Initiate a U2F token authentication. Needs key handle and two 32-byte hash numbers.\n" + "key handle(var 0..255), challenge parameter (32b) and application parameter (32b)", + "hf fido auth --kh 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with 2 parameters, filled 0x00 and key handle\n" + "hf fido auth \n" + "--kh 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f\n" + "--cp 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f \n" + "--ap 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with parameters"); void *argtable[] = { arg_param_begin, @@ -432,10 +437,10 @@ static int cmd_hf_fido_authenticate(const char *cmd) { arg_lit0("u", "user", "mode: enforce-user-presence-and-sign"), arg_lit0("c", "check", "mode: check-only"), arg_str0("j", "json", "fido.json", "JSON input / output file name for parameters."), - arg_str0("k", "key", "public key to verify signature", NULL), - arg_str0(NULL, NULL, "", NULL), - arg_str0(NULL, NULL, "", NULL), - arg_str0(NULL, NULL, "", NULL), + arg_str0("k", "key", "", "public key to verify signature"), + arg_str0(NULL, "kh", "", "key handle (var 0..255b)"), + 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_param_end }; CLIExecWithReturn(ctx, cmd, argtable, true); @@ -684,17 +689,19 @@ static int cmd_hf_fido_2make_credential(const char *cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf fido make", - "Execute a FIDO2 Make Credential command. Needs json file with parameters. Sample file `fido2.json` in `resources/`.", - "hf fido make -> execute command with default parameters file `fido2.json`\n" - "hf fido make test.json -> execute command with parameters file `text.json`"); + "Execute a FIDO2 Make Credential command. Needs json file with parameters.\n" + "Sample file `fido2.json` in `client/resources/`.", + "hf fido make -> default parameters file `fido2.json`\n" + "hf fido make -f test.json -> use parameters file `text.json`" + ); void *argtable[] = { arg_param_begin, - arg_lit0("a", "apdu", "show APDU reqests and responses"), - arg_litn("v", "verbose", 0, 2, "show technical data. vv - show full certificates data"), - arg_lit0("t", "tlv", "Show DER certificate contents in TLV representation"), - arg_lit0("c", "cbor", "show CBOR decoded data"), - arg_str0(NULL, NULL, "", "JSON input / output file name for parameters. Default `fido2.json`"), + arg_lit0("a", "apdu", "show APDU reqests and responses"), + arg_litn("v", "verbose", 0, 2, "show technical data. vv - show full certificates data"), + arg_lit0("t", "tlv", "Show DER certificate contents in TLV representation"), + arg_lit0("c", "cbor", "show CBOR decoded data"), + arg_str0("f", "file", "", "parameter JSON file name. (def `fido2.json`)"), arg_param_end }; CLIExecWithReturn(ctx, cmd, argtable, true); @@ -810,17 +817,20 @@ static int cmd_hf_fido_2get_assertion(const char *cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf fido assert", - "Execute a FIDO2 Get Assertion command. Needs json file with parameters. Sample file `fido2.json` in `resources/`.", - "hf fido assert -> execute command with default parameters file `fido2.json`\n" - "hf fido assert test.json -l -> execute command with parameters file `text.json` and add to request CredentialId"); + "Execute a FIDO2 Get Assertion command. Needs json file with parameters.\n" + "Sample file `fido2.json` in `client/resources/`.\n" + "- Needs if `rk` option is `false` (authenticator doesn't store credential to its memory)" + , + "hf fido assert -> default parameters file `fido2.json`\n" + "hf fido assert -f test.json -l -> use parameters file `text.json` and add to request CredentialId"); void *argtable[] = { arg_param_begin, - arg_lit0("a", "apdu", "show APDU reqests and responses"), - arg_litn("v", "verbose", 0, 2, "show technical data. vv - show full certificates data"), - arg_lit0("c", "cbor", "show CBOR decoded data"), - arg_lit0("l", "list", "add CredentialId from json to allowList. Needs if `rk` option is `false` (authenticator doesn't store credential to its memory)"), - arg_str0(NULL, NULL, "", "JSON input / output file name for parameters. Default `fido2.json`"), + arg_lit0("a", "apdu", "show APDU reqests and responses"), + arg_litn("v", "verbose", 0, 2, "show technical data. vv - show full certificates data"), + arg_lit0("c", "cbor", "show CBOR decoded data"), + arg_lit0("l", "list", "add CredentialId from json to allowList."), + arg_str0("f", "file", "", "parameter JSON file name. (def `fido2.json`)"), arg_param_end }; CLIExecWithReturn(ctx, cmd, argtable, true);