diff --git a/Makefile b/Makefile index ce4f7aa7f..5db304359 100644 --- a/Makefile +++ b/Makefile @@ -204,7 +204,7 @@ help: @echo "+ fpga_compress - Make tools/fpga_compress" @echo @echo "+ style - Apply some automated source code formatting rules" - @echo "+ commands - Regenerate commands documentation files and autocompletion data + @echo "+ commands - Regenerate commands documentation files and autocompletion data" @echo "+ check - Run offline tests. Set CHECKARGS to pass arguments to the test script" @echo "+ .../check - Run offline tests against specific target. See above." @echo "+ miscchecks - Detect various encoding issues in source code" diff --git a/armsrc/appmain.c b/armsrc/appmain.c index 49005a43d..503e68795 100644 --- a/armsrc/appmain.c +++ b/armsrc/appmain.c @@ -1806,7 +1806,7 @@ static void PacketReceived(PacketCommandNG *packet) { struct p { bool turn_off_field; uint8_t keyno; - uint8_t key[18]; + uint8_t key[16]; } PACKED; struct p *payload = (struct p *) packet->data.asBytes; MifareUL_AES_Auth(payload->turn_off_field, payload->keyno, payload->key); diff --git a/client/src/cmdhfmfu.c b/client/src/cmdhfmfu.c index 9b91c08b0..5d14a5e3d 100644 --- a/client/src/cmdhfmfu.c +++ b/client/src/cmdhfmfu.c @@ -3864,17 +3864,17 @@ static int CmdHF14AMfUSim(const char *Cmd) { static int CmdHF14AMfUCAuth(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf mfu cauth", - "Tests 3DES password on Mifare Ultralight-C tag.\n" - "If password is not specified, a set of known defaults will be tested.", + "Tests 3DES key on Mifare Ultralight-C tag.\n" + "If key is not specified, a set of known defaults will be tried.", "hf mfu cauth\n" - "hf mfu cauth --key 000102030405060708090a0b0c0d0e0f" + "hf mfu cauth --key <32 hex chars>" ); void *argtable[] = { arg_param_begin, - arg_str0(NULL, "key", "", "Authentication key (UL-C 16 hex bytes)"), + arg_str0(NULL, "key", "", "Authentication key (16 bytes in hex)"), arg_lit0("l", NULL, "Swap entered key's endianness"), - arg_lit0("k", NULL, "Keep field on (only if a password is provided)"), + arg_lit0("k", NULL, "Keep field on (only if a key is provided)"), arg_param_end }; CLIExecWithReturn(ctx, Cmd, argtable, true); @@ -3925,17 +3925,17 @@ static int CmdHF14AMfUAESAuth(const char *Cmd) { CLIParserContext *ctx; CLIParserInit(&ctx, "hf mfu aesauth", "Tests AES key on Mifare Ultralight AES tags.\n" - "If no key is specified, null key will be tried.\n" + "If key is not specified, null key will be tried.\n" "Key index 0: DataProtKey (default)\n" "Key index 1: UIDRetrKey\n" "Key index 2: OriginalityKey\n", "hf mfu aesauth\n" - "hf mfu aesauth --key <32 bytes> --index <0..2>" + "hf mfu aesauth --key <32 hex chars> --index <0..2>" ); void *argtable[] = { arg_param_begin, - arg_str0(NULL, "key", "", "AES key (32 hex bytes)"), + arg_str0(NULL, "key", "", "Authentication key (16 bytes in hex)"), arg_int0("i", "index", "<0..2>", "Key index, default: 0"), arg_lit0("k", NULL, "Keep field on (only if a key is provided)"), arg_param_end @@ -3943,7 +3943,7 @@ static int CmdHF14AMfUAESAuth(const char *Cmd) { CLIExecWithReturn(ctx, Cmd, argtable, true); int ak_len = 0; - uint8_t authentication_key[32] = {0}; + uint8_t authentication_key[16] = {0}; uint8_t *authKeyPtr = authentication_key; CLIGetHexWithReturn(ctx, 1, authentication_key, &ak_len); int key_index = arg_get_int_def(ctx, 2, 0); @@ -3953,9 +3953,9 @@ static int CmdHF14AMfUAESAuth(const char *Cmd) { if (ak_len == 0) { // default to null key - ak_len = 32; + ak_len = 16; } - if (ak_len != 32) { + if (ak_len != 16) { PrintAndLogEx(WARNING, "Invalid key length"); return PM3_EINVARG; } diff --git a/doc/commands.json b/doc/commands.json index cfe1a6190..24da01cee 100644 --- a/doc/commands.json +++ b/doc/commands.json @@ -7065,15 +7065,15 @@ }, "hf mfu aesauth": { "command": "hf mfu aesauth", - "description": "Tests AES key on Mifare Ultralight AES tags. If no key is specified, null key will be tried. Key index 0: DataProtKey (default) Key index 1: UIDRetrKey Key index 2: OriginalityKey", + "description": "Tests AES key on Mifare Ultralight AES tags. If key is not specified, null key will be tried. Key index 0: DataProtKey (default) Key index 1: UIDRetrKey Key index 2: OriginalityKey", "notes": [ "hf mfu aesauth", - "hf mfu aesauth --key <32 bytes> --index <0..2>" + "hf mfu aesauth --key <32 hex chars> --index <0..2>" ], "offline": false, "options": [ "-h, --help This help", - "--key AES key (32 hex bytes)", + "--key Authentication key (16 bytes in hex)", "-i, --index <0..2> Key index, default: 0", "-k Keep field on (only if a key is provided)" ], @@ -7099,17 +7099,17 @@ }, "hf mfu cauth": { "command": "hf mfu cauth", - "description": "Tests 3DES password on Mifare Ultralight-C tag. If password is not specified, a set of known defaults will be tested.", + "description": "Tests 3DES key on Mifare Ultralight-C tag. If key is not specified, a set of known defaults will be tried.", "notes": [ "hf mfu cauth", - "hf mfu cauth --key 000102030405060708090a0b0c0d0e0f" + "hf mfu cauth --key <32 hex chars>" ], "offline": false, "options": [ "-h, --help This help", - "--key Authentication key (UL-C 16 hex bytes)", + "--key Authentication key (16 bytes in hex)", "-l Swap entered key's endianness", - "-k Keep field on (only if a password is provided)" + "-k Keep field on (only if a key is provided)" ], "usage": "hf mfu cauth [-hlk] [--key ]" }, @@ -13358,6 +13358,6 @@ "metadata": { "commands_extracted": 767, "extracted_by": "PM3Help2JSON v1.00", - "extracted_on": "2025-04-13T10:20:08" + "extracted_on": "2025-04-20T09:18:59" } }