diff --git a/bootrom/bootrom.c b/bootrom/bootrom.c index 2165049f2..0aa34c0d1 100644 --- a/bootrom/bootrom.c +++ b/bootrom/bootrom.c @@ -319,7 +319,7 @@ void BootROM(void) { if ((common_area.command == COMMON_AREA_COMMAND_ENTER_FLASH_MODE) || (!common_area.flags.button_pressed && BUTTON_PRESS()) || - (*(uint32_t*)_osimage_entry == 0xffffffffU)) { + (*(uint32_t *)_osimage_entry == 0xffffffffU)) { flash_mode(); } else { // clear button status, even if button still pressed diff --git a/client/src/cmdhfmfdes.c b/client/src/cmdhfmfdes.c index 774d99415..276891e45 100644 --- a/client/src/cmdhfmfdes.c +++ b/client/src/cmdhfmfdes.c @@ -833,11 +833,11 @@ static int handler_desfire_auth(mfdes_authinput_t *payload, mfdes_auth_res_t *rp } } // else { - /* - cmd[0] = AUTHENTICATE; - cmd[1] = payload->keyno; - len = DesfireAPDU(cmd, 2, resp); - */ + /* + cmd[0] = AUTHENTICATE; + cmd[1] = payload->keyno; + len = DesfireAPDU(cmd, 2, resp); + */ //} if (!recv_len) { @@ -1890,16 +1890,16 @@ static int handler_desfire_readdata(mfdes_data_t *data, MFDES_FILE_TYPE_T type, uint16_t sw = 0; uint32_t resplen = 0; - // we need the CMD 0xBD to calc the CMAC + // we need the CMD 0xBD to calc the CMAC uint8_t tmp_data[8]; // Since the APDU is hardcoded to 7 bytes of payload 7+1 = 8 is enough. tmp_data[0] = 0xBD; - memcpy (&tmp_data[1], data, 7); - + memcpy(&tmp_data[1], data, 7); + // size_t plen = apdu.Lc; // uint8_t *p = mifare_cryto_preprocess_data(tag, (uint8_t *)data, &plen, 0, MDCM_PLAIN | CMAC_COMMAND); // apdu.Lc = (uint8_t)plen; // apdu.data = p; - + size_t plen = 8; uint8_t *p = mifare_cryto_preprocess_data(tag, tmp_data, &plen, 0, MDCM_PLAIN | CMAC_COMMAND); // apdu data does not need the cmd, so use the original read command data. @@ -1986,7 +1986,7 @@ static int handler_desfire_writedata(mfdes_data_t *data, MFDES_FILE_TYPE_T type, tmp[5] = datasize & 0xFF; tmp[6] = (datasize >> 8) & 0xFF; tmp[7] = (datasize >> 16) & 0xFF; - memcpy(&tmp[8],(uint8_t *)&data->data[offset] ,datasize); + memcpy(&tmp[8], (uint8_t *)&data->data[offset], datasize); // size_t plen = datasize; // uint8_t *p = mifare_cryto_preprocess_data(tag, (uint8_t *)&data->data[pos], &plen, 0, cs | MAC_COMMAND | CMAC_COMMAND | ENC_COMMAND); @@ -1995,18 +1995,18 @@ static int handler_desfire_writedata(mfdes_data_t *data, MFDES_FILE_TYPE_T type, // Copy actual data as needed to create APDU Format if (plen != -1) { - memcpy(&tmp[8], &p[8], plen-8); - apdu.Lc = plen -1; //need to drop the OpCode from plen + memcpy(&tmp[8], &p[8], plen - 8); + apdu.Lc = plen - 1; //need to drop the OpCode from plen } -/* - // we dont want to change the value of datasize, so delt with above without change - // Doing so can create wrong offsets and endless loop. - if (plen != -1) datasize = (uint8_t)plen; - memcpy(&tmp[7], p, datasize); + /* + // we dont want to change the value of datasize, so delt with above without change + // Doing so can create wrong offsets and endless loop. + if (plen != -1) datasize = (uint8_t)plen; + memcpy(&tmp[7], p, datasize); - apdu.Lc = datasize + 1 + 3 + 3; -*/ + apdu.Lc = datasize + 1 + 3 + 3; + */ res = send_desfire_cmd(&apdu, false, NULL, &recvlen, &sw, 0, true); if (res != PM3_SUCCESS) { @@ -2045,7 +2045,7 @@ static int handler_desfire_deletefile(uint8_t file_no) { } static int handler_desfire_clearrecordfile(uint8_t file_no) { - if (file_no > 0x1F) + if (file_no > 0x1F) return PM3_EINVARG; sAPDU apdu = {0x90, MFDES_CLEAR_RECORD_FILE, 0x00, 0x00, 1, &file_no}; // 0xEB diff --git a/client/src/cmdlfem410x.c b/client/src/cmdlfem410x.c index bb8bdd46b..5619b9a15 100644 --- a/client/src/cmdlfem410x.c +++ b/client/src/cmdlfem410x.c @@ -419,7 +419,7 @@ static int CmdEM410xSim(const char *Cmd) { // clock is 64 in EM410x tags int clk = arg_get_u32_def(ctx, 1, 64); int uid_len = 0; - int gap = arg_get_u32_def(ctx,3,20); + int gap = arg_get_u32_def(ctx, 3, 20); uint8_t uid[5] = {0}; CLIGetHexWithReturn(ctx, 2, uid, &uid_len); CLIParserFree(ctx); diff --git a/client/src/emv/test/cryptotest.c b/client/src/emv/test/cryptotest.c index 4e6c1192e..cf84ef00e 100644 --- a/client/src/emv/test/cryptotest.c +++ b/client/src/emv/test/cryptotest.c @@ -65,7 +65,7 @@ int ExecuteCryptoTests(bool verbose, bool ignore_time, bool include_slow_tests) PrintAndLogEx(WARNING, "Repeat timing test " _RED_("%d"), i + 1); } if (res && !ignore_time) TestFail = true; -*/ + */ res = mbedtls_ctr_drbg_self_test(verbose); if (res) TestFail = true; diff --git a/client/src/wiegand_formats.c b/client/src/wiegand_formats.c index b989aeff1..0daf1dd5d 100644 --- a/client/src/wiegand_formats.c +++ b/client/src/wiegand_formats.c @@ -1365,7 +1365,7 @@ static const cardformat_t FormatTable[] = { {"P10001", Pack_P10001, Unpack_P10001, "HID P10001 Honeywell 40-bit", {1, 1, 0, 1, 0}}, // from cardinfo.barkweb.com.au {"Casi40", Pack_CasiRusco40, Unpack_CasiRusco40, "Casi-Rusco 40-bit", {1, 0, 0, 0, 0}}, // from cardinfo.barkweb.com.au {"C1k48s", Pack_C1k48s, Unpack_C1k48s, "HID Corporate 1000 48-bit std", {1, 1, 0, 0, 1}}, // imported from old pack/unpack - {"BC40", Pack_bc40, Unpack_bc40, "Bundy TimeClock 40-bit", {1, 1, 0, 1, 1}}, // from + {"BC40", Pack_bc40, Unpack_bc40, "Bundy TimeClock 40-bit", {1, 1, 0, 1, 1}}, // from {NULL, NULL, NULL, NULL, {0, 0, 0, 0, 0}} // Must null terminate array }; diff --git a/tools/mf_nonce_brute/mf_trace_brute.c b/tools/mf_nonce_brute/mf_trace_brute.c index 67451acf8..18b9c67bd 100644 --- a/tools/mf_nonce_brute/mf_trace_brute.c +++ b/tools/mf_nonce_brute/mf_trace_brute.c @@ -195,7 +195,7 @@ static bool checkValidCmdByte(uint8_t *cmd, uint16_t n) { static void *brute_thread(void *arguments) { struct thread_args *args = (struct thread_args *) arguments; - uint64_t key = args->part_key; + uint64_t key = args->part_key; uint8_t local_enc[args->enc_len]; memcpy(local_enc, args->enc, args->enc_len);