mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-01-10 10:11:58 +08:00
style
This commit is contained in:
parent
f83fa37b86
commit
1ff1fa7385
4 changed files with 15 additions and 15 deletions
|
@ -174,7 +174,7 @@ static int CmdHFFidoRegister(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *root = NULL;
|
json_t *root = NULL;
|
||||||
int res = loadFileJSONroot(filename, (void**)&root, verbose);
|
int res = loadFileJSONroot(filename, (void **)&root, verbose);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
@ -357,7 +357,7 @@ static int CmdHFFidoRegister(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )" , res);
|
PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
PrintAndLogEx(INFO, "");
|
PrintAndLogEx(INFO, "");
|
||||||
|
@ -390,7 +390,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) {
|
||||||
CLIParserInit(&ctx, "hf fido auth",
|
CLIParserInit(&ctx, "hf fido auth",
|
||||||
"Initiate a U2F token authentication. Needs key handle and two 32-byte hash numbers.\n"
|
"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"
|
"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",
|
"\n",
|
||||||
"hf fido auth --kh 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with 2 parameters, filled 0x00 and key handle\n"
|
"hf fido auth --kh 000102030405060708090a0b0c0d0e0f000102030405060708090a0b0c0d0e0f -> execute command with 2 parameters, filled 0x00 and key handle\n"
|
||||||
"hf fido auth \n"
|
"hf fido auth \n"
|
||||||
|
@ -444,9 +444,9 @@ static int CmdHFFidoAuthenticate(const char *cmd) {
|
||||||
strcat(filename, DEF_FIDO_PARAM_FILE);
|
strcat(filename, DEF_FIDO_PARAM_FILE);
|
||||||
fnlen = strlen(filename);
|
fnlen = strlen(filename);
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *root = NULL;
|
json_t *root = NULL;
|
||||||
int res = loadFileJSONroot(filename, (void**)&root, verbose);
|
int res = loadFileJSONroot(filename, (void **)&root, verbose);
|
||||||
if (res != PM3_SUCCESS) {
|
if (res != PM3_SUCCESS) {
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
@ -623,7 +623,7 @@ static int CmdHFFidoAuthenticate(const char *cmd) {
|
||||||
PrintAndLogEx(WARNING, "No public key provided. can't check signature.");
|
PrintAndLogEx(WARNING, "No public key provided. can't check signature.");
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )" , res);
|
PrintAndLogEx(WARNING, "Invalid signature. res = %d. ( " _RED_("fail") " )", res);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (root) {
|
if (root) {
|
||||||
|
@ -678,7 +678,7 @@ static int CmdHFFido2MakeCredential(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *root = NULL;
|
json_t *root = NULL;
|
||||||
loadFileJSONroot(filename, (void**)&root, verbose);
|
loadFileJSONroot(filename, (void **)&root, verbose);
|
||||||
if (root == NULL) {
|
if (root == NULL) {
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
|
@ -797,7 +797,7 @@ static int CmdHFFido2GetAssertion(const char *cmd) {
|
||||||
}
|
}
|
||||||
|
|
||||||
json_t *root = NULL;
|
json_t *root = NULL;
|
||||||
loadFileJSONroot(filename, (void**)&root, verbose);
|
loadFileJSONroot(filename, (void **)&root, verbose);
|
||||||
if (root == NULL) {
|
if (root == NULL) {
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
|
|
|
@ -425,7 +425,7 @@ int infoLTO(bool verbose) {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
PrintAndLogEx(NORMAL, "");
|
PrintAndLogEx(NORMAL, "");
|
||||||
lto_switch_off_field();
|
lto_switch_off_field();
|
||||||
return ret_val;
|
return ret_val;
|
||||||
|
|
|
@ -2424,7 +2424,7 @@ static int CmdHF14ADesCreateApp(const char *Cmd) {
|
||||||
int keylen2 = 1;
|
int keylen2 = 1;
|
||||||
uint8_t keysetting2[1] = {0};
|
uint8_t keysetting2[1] = {0};
|
||||||
CLIGetHexWithReturn(ctx, 4, keysetting2, &keylen2);
|
CLIGetHexWithReturn(ctx, 4, keysetting2, &keylen2);
|
||||||
|
|
||||||
int namelen = 16;
|
int namelen = 16;
|
||||||
uint8_t name[16] = {0};
|
uint8_t name[16] = {0};
|
||||||
CLIGetStrWithReturn(ctx, 5, name, &namelen);
|
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_strx0("a", "aid", "<hex>", "App ID to select as hex bytes (3 bytes, big endian)"),
|
||||||
arg_param_end
|
arg_param_end
|
||||||
};
|
};
|
||||||
|
|
||||||
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
CLIExecWithReturn(ctx, Cmd, argtable, false);
|
||||||
|
|
||||||
mfdes_value_t value;
|
mfdes_value_t value;
|
||||||
|
@ -3205,7 +3205,7 @@ static int CmdHF14ADesCreateRecordFile(const char *Cmd) {
|
||||||
CLIGetHexWithReturn(ctx, 6, maxnumrecords, &msizelen);
|
CLIGetHexWithReturn(ctx, 6, maxnumrecords, &msizelen);
|
||||||
|
|
||||||
bool cyclic = arg_get_lit(ctx, 7);
|
bool cyclic = arg_get_lit(ctx, 7);
|
||||||
|
|
||||||
int aidlength = 3;
|
int aidlength = 3;
|
||||||
uint8_t aid[3] = {0};
|
uint8_t aid[3] = {0};
|
||||||
CLIGetHexWithReturn(ctx, 8, aid, &aidlength);
|
CLIGetHexWithReturn(ctx, 8, aid, &aidlength);
|
||||||
|
|
|
@ -676,16 +676,16 @@ int saveFileJSONroot(const char *preferredName, void *root, size_t flags, bool v
|
||||||
|
|
||||||
int res = json_dump_file(root, filename, flags);
|
int res = json_dump_file(root, filename, flags);
|
||||||
|
|
||||||
if ( res == 0 ) {
|
if (res == 0) {
|
||||||
if (verbose) {
|
if (verbose) {
|
||||||
PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), filename);
|
PrintAndLogEx(SUCCESS, "saved to json file " _YELLOW_("%s"), filename);
|
||||||
}
|
}
|
||||||
free(filename);
|
free(filename);
|
||||||
return PM3_SUCCESS;
|
return PM3_SUCCESS;
|
||||||
} else {
|
} else {
|
||||||
PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), filename);
|
PrintAndLogEx(FAILED, "error: can't save the file: " _YELLOW_("%s"), filename);
|
||||||
}
|
}
|
||||||
free(filename);
|
free(filename);
|
||||||
return PM3_EFILE;
|
return PM3_EFILE;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue