From 1ff1fa7385bf23783b22e0532f894f3715c7790a Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 11 May 2021 15:43:12 +0200 Subject: [PATCH] style --- client/src/cmdhffido.c | 16 ++++++++-------- client/src/cmdhflto.c | 2 +- client/src/cmdhfmfdes.c | 6 +++--- client/src/fileutils.c | 6 +++--- 4 files changed, 15 insertions(+), 15 deletions(-) diff --git a/client/src/cmdhffido.c b/client/src/cmdhffido.c index 57257c459..80758f309 100644 --- a/client/src/cmdhffido.c +++ b/client/src/cmdhffido.c @@ -174,7 +174,7 @@ static int CmdHFFidoRegister(const char *cmd) { } json_t *root = NULL; - int res = loadFileJSONroot(filename, (void**)&root, verbose); + int res = loadFileJSONroot(filename, (void **)&root, verbose); if (res != PM3_SUCCESS) { CLIParserFree(ctx); return PM3_EINVARG; @@ -357,7 +357,7 @@ static int CmdHFFidoRegister(const char *cmd) { } } else { - PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )" , res); + PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )", res); } PrintAndLogEx(INFO, ""); @@ -390,7 +390,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) { CLIParserInit(&ctx, "hf fido auth", "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)\n" - "The output template filename is `hf-fido2-params.json`\n" + "The output template filename is `hf-fido2-params.json`\n" "\n", "hf fido auth --kh 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with 2 parameters, filled 0x00 and key handle\n" "hf fido auth \n" @@ -444,9 +444,9 @@ static int CmdHFFidoAuthenticate(const char *cmd) { strcat(filename, DEF_FIDO_PARAM_FILE); fnlen = strlen(filename); } - + json_t *root = NULL; - int res = loadFileJSONroot(filename, (void**)&root, verbose); + int res = loadFileJSONroot(filename, (void **)&root, verbose); if (res != PM3_SUCCESS) { CLIParserFree(ctx); return PM3_EINVARG; @@ -623,7 +623,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) { PrintAndLogEx(WARNING, "No public key provided. can't check signature."); } } else { - PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )" , res); + PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )", res); } if (root) { @@ -678,7 +678,7 @@ static int CmdHFFido2MakeCredential(const char *cmd) { } json_t *root = NULL; - loadFileJSONroot(filename, (void**)&root, verbose); + loadFileJSONroot(filename, (void **)&root, verbose); if (root == NULL) { return PM3_EFILE; } @@ -797,7 +797,7 @@ static int CmdHFFido2GetAssertion(const char *cmd) { } json_t *root = NULL; - loadFileJSONroot(filename, (void**)&root, verbose); + loadFileJSONroot(filename, (void **)&root, verbose); if (root == NULL) { return PM3_EFILE; } diff --git a/client/src/cmdhflto.c b/client/src/cmdhflto.c index db9fdf42b..2ed540fd0 100644 --- a/client/src/cmdhflto.c +++ b/client/src/cmdhflto.c @@ -425,7 +425,7 @@ int infoLTO(bool verbose) { } - } + } PrintAndLogEx(NORMAL, ""); lto_switch_off_field(); return ret_val; diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 23137d31b..f49b3f4d5 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -2424,7 +2424,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) { int keylen2 = 1; uint8_t keysetting2[1] = {0}; CLIGetHexWithReturn(ctx, 4, keysetting2, &keylen2); - + int namelen = 16; uint8_t name[16] = {0}; CLIGetStrWithReturn(ctx, 5, name, &namelen); @@ -2991,7 +2991,7 @@ static int CmdHF14ADesChangeValue(const char *Cmd) { arg_strx0("a", "aid", "", "App ID to select as hex bytes (3 bytes, big endian)"), arg_param_end }; - + CLIExecWithReturn(ctx, Cmd, argtable, false); mfdes_value_t value; @@ -3205,7 +3205,7 @@ static int CmdHF14ADesCreateRecordFile(const char *Cmd) { CLIGetHexWithReturn(ctx, 6, maxnumrecords, &msizelen); bool cyclic = arg_get_lit(ctx, 7); - + int aidlength = 3; uint8_t aid[3] = {0}; CLIGetHexWithReturn(ctx, 8, aid, &aidlength); diff --git a/client/src/fileutils.c b/client/src/fileutils.c index 028db71e0..3f416e9e4 100644 --- a/client/src/fileutils.c +++ b/client/src/fileutils.c @@ -676,16 +676,16 @@ int saveFileJSONroot(const char *preferredName, void *root, size_t flags, bool v int res = json_dump_file(root, filename, flags); - if ( res == 0 ) { + if (res == 0) { if (verbose) { PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), filename); } - free(filename); + free(filename); return PM3_SUCCESS; } else { PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), filename); } - free(filename); + free(filename); return PM3_EFILE; }