Change logs to info. Make style.

This commit is contained in:
Thomas Sutter 2019-12-16 11:25:15 +01:00
commit d1906aa03e
3 changed files with 13 additions and 14 deletions

View file

@ -536,7 +536,7 @@ int send_wr_unencrypted(uint8_t flags, uint16_t datalen, uint8_t *data, bool ver
* @return client result code.
*/
static int CmdHFFelicaAuthentication1(const char *Cmd) {
if (strlen(Cmd) < 4){
if (strlen(Cmd) < 4) {
return usage_hf_felica_authentication1();
}
uint8_t data[PM3_CMD_DATA_SIZE];
@ -597,25 +597,24 @@ static int CmdHFFelicaAuthentication1(const char *Cmd) {
uint8_t master_key[PM3_CMD_DATA_SIZE];
mbedtls_des3_context des3_ctx;
mbedtls_des3_init(&des3_ctx);
if(param_getlength(Cmd, paramCount) == 24){
if (param_getlength(Cmd, paramCount) == 24) {
param_gethex(Cmd, paramCount, master_key, 24);
mbedtls_des3_set3key_enc(&des3_ctx, master_key);
PrintAndLogEx(NORMAL, "3DES Master Secret: %s", sprint_hex(master_key, 12));
}
else if (param_getlength(Cmd, paramCount) == 16) {
PrintAndLogEx(INFO, "3DES Master Secret: %s", sprint_hex(master_key, 12));
} else if (param_getlength(Cmd, paramCount) == 16) {
param_gethex(Cmd, paramCount, master_key, 16);
mbedtls_des3_set2key_enc(&des3_ctx, master_key);
PrintAndLogEx(NORMAL, "3DES Master Secret: %s", sprint_hex(master_key, 8));
}else{
PrintAndLogEx(ERR, "Invalid Key length");
PrintAndLogEx(INFO, "3DES Master Secret: %s", sprint_hex(master_key, 8));
} else {
PrintAndLogEx(ERR, "Invalid key length");
return PM3_EINVARG;
}
mbedtls_des3_crypt_ecb(&des3_ctx, input, output);
PrintAndLogEx(NORMAL, "3DES ENCRYPTED M1c: %s", sprint_hex(output, 8));
PrintAndLogEx(INFO, "3DES ENCRYPTED M1c: %s", sprint_hex(output, 8));
// Add M1c Challenge to frame
int frame_position = 16;
for(int i=0; i < 8; i++){
for (int i = 0; i < 8; i++) {
data[frame_position++] = output[i];
}
@ -624,7 +623,7 @@ static int CmdHFFelicaAuthentication1(const char *Cmd) {
flags |= FELICA_APPEND_CRC;
flags |= FELICA_RAW;
PrintAndLogEx(NORMAL, "Client Send AUTH1 Frame: %s", sprint_hex(data, datalen));
PrintAndLogEx(INFO, "Client Send AUTH1 Frame: %s", sprint_hex(data, datalen));
clear_and_send_command(flags, datalen, data, 0);
PacketResponseNG resp;

View file

@ -447,7 +447,7 @@ static int CmdSetDivisor(const char *Cmd) {
uint8_t arg = param_get8ex(Cmd, 0, 95, 10);
if (arg < 19) {
PrintAndLogEx(ERR, "divisor must be between" _YELLOW_("19") " and " _YELLOW_("255") );
PrintAndLogEx(ERR, "divisor must be between" _YELLOW_("19") " and " _YELLOW_("255"));
return PM3_EINVARG;
}
// 12 000 000 (12MHz)

View file

@ -81,7 +81,7 @@ static int CmdNexWatchDemod(const char *Cmd) {
//checksum check (TBD)
//output
PrintAndLogEx(SUCCESS, "NexWatch ID: " _YELLOW_("%"PRIu32) , ID);
PrintAndLogEx(SUCCESS, "NexWatch ID: " _YELLOW_("%"PRIu32), ID);
if (invert) {
PrintAndLogEx(INFO, "Had to Invert - probably NexKey");
for (size_t i = 0; i < size; i++)