Skip to content

Commit 20a0bc3

Browse files
committed
style
1 parent 9ebe5ae commit 20a0bc3

File tree

12 files changed

+56
-48
lines changed

12 files changed

+56
-48
lines changed

armsrc/hitagS.c

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -39,16 +39,16 @@
3939

4040
static struct hitagS_tag tag = {
4141
.pages =
42-
{
43-
// Plain mode: | Authentication mode:
44-
[0] = {0x88, 0xcd, 0x6d, 0xf3}, // UID | UID
45-
[1] = {0xca, 0x24, 0x00, 0x00}, // CON0 CON1 CON2 Reserved | CON0 CON1 CON2 PWDH0
46-
[2] = {0xaa, 0xaa, 0xaa, 0xaa}, // Data | PWDL0 PWDL1 KEYH0 KEYH1
47-
[3] = {0x55, 0x55, 0x55, 0x55}, // Data | KEYL0 KEYL1 KEYL2 KEYL3
48-
[4] = {0xff, 0x80, 0x00, 0x00}, // Data
49-
[5] = {0x00, 0x00, 0x00, 0x00}, // Data
50-
// up to index 63 for HITAG S2048 public data
51-
},
42+
{
43+
// Plain mode: | Authentication mode:
44+
[0] = {0x88, 0xcd, 0x6d, 0xf3}, // UID | UID
45+
[1] = {0xca, 0x24, 0x00, 0x00}, // CON0 CON1 CON2 Reserved | CON0 CON1 CON2 PWDH0
46+
[2] = {0xaa, 0xaa, 0xaa, 0xaa}, // Data | PWDL0 PWDL1 KEYH0 KEYH1
47+
[3] = {0x55, 0x55, 0x55, 0x55}, // Data | KEYL0 KEYL1 KEYL2 KEYL3
48+
[4] = {0xff, 0x80, 0x00, 0x00}, // Data
49+
[5] = {0x00, 0x00, 0x00, 0x00}, // Data
50+
// up to index 63 for HITAG S2048 public data
51+
},
5252
};
5353
static uint8_t page_to_be_written = 0;
5454
static int block_data_left = 0;

armsrc/mifarecmd.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -2400,12 +2400,12 @@ int MifareECardLoad(uint8_t sectorcnt, uint8_t keytype) {
24002400
ui64Key = emlGetKey(s, MF_KEY_B);
24012401

24022402
if (mifare_classic_auth(pcs, cuid, FirstBlockOfSector(s), MF_KEY_B, ui64Key, AUTH_FIRST)) {
2403-
retval = PM3_EPARTIAL;
2404-
if (g_dbglevel >= DBG_ERROR) {
2405-
Dbprintf("Sector %2d - Auth error", s);
2403+
retval = PM3_EPARTIAL;
2404+
if (g_dbglevel >= DBG_ERROR) {
2405+
Dbprintf("Sector %2d - Auth error", s);
2406+
}
2407+
continue;
24062408
}
2407-
continue;
2408-
}
24092409
}
24102410

24112411

client/lualibs/trace_parse.lua

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
--[[
2-
Simple Trace Parser library
1+
--[[
2+
Simple Trace Parser library
33
44
-- fair warning, this is best to just get trace data values, I didn't see any better implementation for this, so I just made one myself
55

client/src/cmdhf14a.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2264,7 +2264,7 @@ int infoHF14A(bool verbose, bool do_nack_test, bool do_aid_search) {
22642264
card.ats_len = resp.oldarg[0]; // note: ats_len includes CRC Bytes
22652265
if (card.ats_len > 3) {
22662266
select_status = 1;
2267-
}
2267+
}
22682268
}
22692269

22702270
if (card.ats_len >= 3) { // a valid ATS consists of at least the length byte (TL) and 2 CRC bytes

client/src/cmdhfmf.c

Lines changed: 17 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -3646,7 +3646,7 @@ static int CmdHF14AMfSmartBrute(const char *Cmd) {
36463646

36473647
PrintAndLogEx(INFO, "Current cracking speed (keys/s): %lu",
36483648
keys_checked / ((msclock() - t1) / 1000)
3649-
);
3649+
);
36503650

36513651
t1 = msclock();
36523652
keys_checked = 0;
@@ -7881,8 +7881,8 @@ static int parse_gtu_cfg(uint8_t *d, size_t n) {
78817881
PrintAndLogEx(INFO, _CYAN_("Config 2 - ATS"));
78827882
PrintAndLogEx(INFO, "%s", sprint_hex_inrow(d + 8, 16));
78837883
if (atslen <= 16) {
7884-
PrintAndLogEx(INFO, "%s.............. ATS ( %d bytes )", sprint_hex_inrow(&d[8], d[7]), d[7]);
7885-
PrintAndLogEx(INFO, "..................%s Reserved for ATS", sprint_hex_inrow(d + 8 + d[7], 16 - d[7]));
7884+
PrintAndLogEx(INFO, "%s.............. ATS ( %d bytes )", sprint_hex_inrow(&d[8], d[7]), d[7]);
7885+
PrintAndLogEx(INFO, "..................%s Reserved for ATS", sprint_hex_inrow(d + 8 + d[7], 16 - d[7]));
78867886
} else {
78877887
PrintAndLogEx(INFO, "%s.............. %u Reserved for ATS", sprint_hex_inrow(&d[8], 16), 16);
78887888
}
@@ -9631,20 +9631,20 @@ static int CmdHF14AMfInfo(const char *Cmd) {
96319631
} else if (fKeyType == MF_KEY_BD08 || fKeyType == MF_KEY_BD08S || fKeyType == MF_KEY_BD32) {
96329632
PrintAndLogEx(SUCCESS, _RED_("Unknown card with backdoor, please report details!"));
96339633
} else
9634-
// other cards
9635-
if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x46", 4) == 0) {
9636-
PrintAndLogEx(SUCCESS, "NXP MF1ICS5005");
9637-
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x47", 4) == 0) {
9638-
PrintAndLogEx(SUCCESS, "NXP MF1ICS5006");
9639-
} else if (card.sak == 0x09 && memcmp(blockdata + 5, "\x89\x04\x00\x47", 4) == 0) {
9640-
PrintAndLogEx(SUCCESS, "NXP MF1ICS2006");
9641-
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x48", 4) == 0) {
9642-
PrintAndLogEx(SUCCESS, "NXP MF1ICS5007");
9643-
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\xc0", 4) == 0) {
9644-
PrintAndLogEx(SUCCESS, "NXP MF1ICS5035");
9645-
} else {
9646-
PrintAndLogEx(SUCCESS, "unknown");
9647-
}
9634+
// other cards
9635+
if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x46", 4) == 0) {
9636+
PrintAndLogEx(SUCCESS, "NXP MF1ICS5005");
9637+
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x47", 4) == 0) {
9638+
PrintAndLogEx(SUCCESS, "NXP MF1ICS5006");
9639+
} else if (card.sak == 0x09 && memcmp(blockdata + 5, "\x89\x04\x00\x47", 4) == 0) {
9640+
PrintAndLogEx(SUCCESS, "NXP MF1ICS2006");
9641+
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\x48", 4) == 0) {
9642+
PrintAndLogEx(SUCCESS, "NXP MF1ICS5007");
9643+
} else if (card.sak == 0x08 && memcmp(blockdata + 5, "\x88\x04\x00\xc0", 4) == 0) {
9644+
PrintAndLogEx(SUCCESS, "NXP MF1ICS5035");
9645+
} else {
9646+
PrintAndLogEx(SUCCESS, "unknown");
9647+
}
96489648

96499649
if (e_sector[1].foundKey[MF_KEY_A] && (e_sector[1].Key[MF_KEY_A] == 0x2A2C13CC242A)) {
96509650
PrintAndLogEx(SUCCESS, "Dorma Kaba SAFLOK detected");

client/src/cmdhfmfu.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4130,7 +4130,7 @@ static int CmdHF14AMfUCSetUid(const char *Cmd) {
41304130
SendCommandNG(CMD_HF_ISO14443A_GET_CONFIG, NULL, 0);
41314131
if (!WaitForResponseTimeout(CMD_HF_ISO14443A_GET_CONFIG, &resp, 2000)) {
41324132
PrintAndLogEx(WARNING, "command execution time out);
4133-
return PM3_ETIMEOUT;
4133+
return PM3_ETIMEOUT;
41344134
}
41354135
memcpy(&config, resp.data.asBytes, sizeof(hf14a_config));
41364136
int8_t oldconfig_bcc = config.forcebcc;

client/src/cmdlfem410x.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -792,7 +792,7 @@ static int CmdEM410xClone(const char *Cmd) {
792792
}
793793

794794
packet.cmd = WHTSF_82xx;
795-
memcpy(packet.pwd, (uint8_t[]){0xBB, 0xDD, 0x33, 0x99}, 4);
795+
memcpy(packet.pwd, (uint8_t[]) {0xBB, 0xDD, 0x33, 0x99}, 4);
796796
SendCommandNG(CMD_LF_HITAGS_WRITE, (uint8_t *)&packet, sizeof(packet));
797797
if (WaitForResponseTimeout(CMD_LF_HITAGS_WRITE, &resp, 4000) == false) {
798798
PrintAndLogEx(WARNING, "timeout while waiting for reply.");

client/src/cmdlfhitaghts.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ static int CmdLFHitagSRead(const char *Cmd) {
107107
use_crypto = true;
108108
}
109109
if ((key_len == 0) && use_82xx) {
110-
memcpy(key, (uint8_t[]){0xBB, 0xDD, 0x33, 0x99}, 4);
110+
memcpy(key, (uint8_t[]) {0xBB, 0xDD, 0x33, 0x99}, 4);
111111
key_len = 4;
112112
}
113113
if ((key_len == 0) && use_crypto) {
@@ -266,7 +266,7 @@ static int CmdLFHitagSWrite(const char *Cmd) {
266266
use_crypto = true;
267267
}
268268
if ((key_len == 0) && use_82xx) {
269-
memcpy(key, (uint8_t[]){0xBB, 0xDD, 0x33, 0x99}, 4);
269+
memcpy(key, (uint8_t[]) {0xBB, 0xDD, 0x33, 0x99}, 4);
270270
key_len = 4;
271271
}
272272
if ((key_len == 0) && use_crypto) {

client/src/cmdscript.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -301,8 +301,8 @@ static int CmdScriptRun(const char *Cmd) {
301301
// and be able to send in parameters into script meanwhile
302302
// being able to "-h" here too.
303303
if ((strlen(filename) == 0) ||
304-
(strcmp(filename, "-h") == 0) ||
305-
(strcmp(filename, "--help") == 0)) {
304+
(strcmp(filename, "-h") == 0) ||
305+
(strcmp(filename, "--help") == 0)) {
306306
ctx->argtable = argtable;
307307
ctx->argtableLen = arg_getsize(argtable);
308308
CLIParserPrintHelp(ctx);

client/src/emv/emv_pk.c

Lines changed: 11 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -448,9 +448,12 @@ static struct emv_pk *emv_pk_get_ca_pk_from_file(const char *fname,
448448
return NULL;
449449
}
450450

451+
// not used
452+
/*
451453
char *emv_pk_get_ca_pk_file(const char *dirname, const unsigned char *rid, unsigned char idx) {
452-
if (!dirname)
454+
if (dirname == NULL) {
453455
dirname = ".";//openemv_config_get_str("capk.dir", NULL);
456+
}
454457
455458
char *filename;
456459
int ret = asprintf(&filename, "%s/%02hhx%02hhx%02hhx%02hhx%02hhx_%02hhx.0",
@@ -462,15 +465,17 @@ char *emv_pk_get_ca_pk_file(const char *dirname, const unsigned char *rid, unsig
462465
rid[4],
463466
idx);
464467
465-
if (ret <= 0)
468+
if (ret <= 0) {
466469
return NULL;
470+
}
467471
468472
return filename;
469473
}
470474
471475
char *emv_pk_get_ca_pk_rid_file(const char *dirname, const unsigned char *rid) {
472-
if (!dirname)
476+
if (dirname == NULL) {
473477
dirname = "."; //openemv_config_get_str("capk.dir", NULL);
478+
}
474479
475480
char *filename;
476481
int ret = asprintf(&filename, "%s/%02hhx%02hhx%02hhx%02hhx%02hhx.pks",
@@ -481,11 +486,13 @@ char *emv_pk_get_ca_pk_rid_file(const char *dirname, const unsigned char *rid) {
481486
rid[3],
482487
rid[4]);
483488
484-
if (ret <= 0)
489+
if (ret <= 0) {
485490
return NULL;
491+
}
486492
487493
return filename;
488494
}
495+
*/
489496

490497
struct emv_pk *emv_pk_get_ca_pk(const unsigned char *rid, unsigned char idx) {
491498
struct emv_pk *pk = NULL;

0 commit comments

Comments
 (0)