This commit is contained in:
iceman1001 2021-05-11 15:43:12 +02:00
parent f83fa37b86
commit 1ff1fa7385
4 changed files with 15 additions and 15 deletions

View file

@ -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;
}

View file

@ -425,7 +425,7 @@ int infoLTO(bool verbose) {
}
}
}
PrintAndLogEx(NORMAL, "");
lto_switch_off_field();
return ret_val;

View file

@ -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", "<hex>", "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);

View file

@ -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;
}