mirror of
https://github.com/RfidResearchGroup/proxmark3.git
synced 2025-08-19 13:00:42 -07:00
make style
This commit is contained in:
parent
76adb58feb
commit
a592b349cb
6 changed files with 25 additions and 25 deletions
|
@ -319,7 +319,7 @@ void BootROM(void) {
|
||||||
|
|
||||||
if ((common_area.command == COMMON_AREA_COMMAND_ENTER_FLASH_MODE) ||
|
if ((common_area.command == COMMON_AREA_COMMAND_ENTER_FLASH_MODE) ||
|
||||||
(!common_area.flags.button_pressed && BUTTON_PRESS()) ||
|
(!common_area.flags.button_pressed && BUTTON_PRESS()) ||
|
||||||
(*(uint32_t*)_osimage_entry == 0xffffffffU)) {
|
(*(uint32_t *)_osimage_entry == 0xffffffffU)) {
|
||||||
flash_mode();
|
flash_mode();
|
||||||
} else {
|
} else {
|
||||||
// clear button status, even if button still pressed
|
// clear button status, even if button still pressed
|
||||||
|
|
|
@ -833,11 +833,11 @@ static int handler_desfire_auth(mfdes_authinput_t *payload, mfdes_auth_res_t *rp
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// else {
|
// else {
|
||||||
/*
|
/*
|
||||||
cmd[0] = AUTHENTICATE;
|
cmd[0] = AUTHENTICATE;
|
||||||
cmd[1] = payload->keyno;
|
cmd[1] = payload->keyno;
|
||||||
len = DesfireAPDU(cmd, 2, resp);
|
len = DesfireAPDU(cmd, 2, resp);
|
||||||
*/
|
*/
|
||||||
//}
|
//}
|
||||||
|
|
||||||
if (!recv_len) {
|
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;
|
uint16_t sw = 0;
|
||||||
uint32_t resplen = 0;
|
uint32_t resplen = 0;
|
||||||
|
|
||||||
// we need the CMD 0xBD <data> to calc the CMAC
|
// we need the CMD 0xBD <data> to calc the CMAC
|
||||||
uint8_t tmp_data[8]; // Since the APDU is hardcoded to 7 bytes of payload 7+1 = 8 is enough.
|
uint8_t tmp_data[8]; // Since the APDU is hardcoded to 7 bytes of payload 7+1 = 8 is enough.
|
||||||
tmp_data[0] = 0xBD;
|
tmp_data[0] = 0xBD;
|
||||||
memcpy (&tmp_data[1], data, 7);
|
memcpy(&tmp_data[1], data, 7);
|
||||||
|
|
||||||
// size_t plen = apdu.Lc;
|
// size_t plen = apdu.Lc;
|
||||||
// uint8_t *p = mifare_cryto_preprocess_data(tag, (uint8_t *)data, &plen, 0, MDCM_PLAIN | CMAC_COMMAND);
|
// uint8_t *p = mifare_cryto_preprocess_data(tag, (uint8_t *)data, &plen, 0, MDCM_PLAIN | CMAC_COMMAND);
|
||||||
// apdu.Lc = (uint8_t)plen;
|
// apdu.Lc = (uint8_t)plen;
|
||||||
// apdu.data = p;
|
// apdu.data = p;
|
||||||
|
|
||||||
size_t plen = 8;
|
size_t plen = 8;
|
||||||
uint8_t *p = mifare_cryto_preprocess_data(tag, tmp_data, &plen, 0, MDCM_PLAIN | CMAC_COMMAND);
|
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.
|
// 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[5] = datasize & 0xFF;
|
||||||
tmp[6] = (datasize >> 8) & 0xFF;
|
tmp[6] = (datasize >> 8) & 0xFF;
|
||||||
tmp[7] = (datasize >> 16) & 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;
|
// 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);
|
// 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
|
// Copy actual data as needed to create APDU Format
|
||||||
if (plen != -1) {
|
if (plen != -1) {
|
||||||
memcpy(&tmp[8], &p[8], plen-8);
|
memcpy(&tmp[8], &p[8], plen - 8);
|
||||||
apdu.Lc = plen -1; //need to drop the OpCode from plen
|
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
|
// we dont want to change the value of datasize, so delt with above without change
|
||||||
// Doing so can create wrong offsets and endless loop.
|
// Doing so can create wrong offsets and endless loop.
|
||||||
if (plen != -1) datasize = (uint8_t)plen;
|
if (plen != -1) datasize = (uint8_t)plen;
|
||||||
memcpy(&tmp[7], p, datasize);
|
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);
|
res = send_desfire_cmd(&apdu, false, NULL, &recvlen, &sw, 0, true);
|
||||||
if (res != PM3_SUCCESS) {
|
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) {
|
static int handler_desfire_clearrecordfile(uint8_t file_no) {
|
||||||
if (file_no > 0x1F)
|
if (file_no > 0x1F)
|
||||||
return PM3_EINVARG;
|
return PM3_EINVARG;
|
||||||
|
|
||||||
sAPDU apdu = {0x90, MFDES_CLEAR_RECORD_FILE, 0x00, 0x00, 1, &file_no}; // 0xEB
|
sAPDU apdu = {0x90, MFDES_CLEAR_RECORD_FILE, 0x00, 0x00, 1, &file_no}; // 0xEB
|
||||||
|
|
|
@ -419,7 +419,7 @@ static int CmdEM410xSim(const char *Cmd) {
|
||||||
// clock is 64 in EM410x tags
|
// clock is 64 in EM410x tags
|
||||||
int clk = arg_get_u32_def(ctx, 1, 64);
|
int clk = arg_get_u32_def(ctx, 1, 64);
|
||||||
int uid_len = 0;
|
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};
|
uint8_t uid[5] = {0};
|
||||||
CLIGetHexWithReturn(ctx, 2, uid, &uid_len);
|
CLIGetHexWithReturn(ctx, 2, uid, &uid_len);
|
||||||
CLIParserFree(ctx);
|
CLIParserFree(ctx);
|
||||||
|
|
|
@ -65,7 +65,7 @@ int ExecuteCryptoTests(bool verbose, bool ignore_time, bool include_slow_tests)
|
||||||
PrintAndLogEx(WARNING, "Repeat timing test " _RED_("%d"), i + 1);
|
PrintAndLogEx(WARNING, "Repeat timing test " _RED_("%d"), i + 1);
|
||||||
}
|
}
|
||||||
if (res && !ignore_time) TestFail = true;
|
if (res && !ignore_time) TestFail = true;
|
||||||
*/
|
*/
|
||||||
|
|
||||||
res = mbedtls_ctr_drbg_self_test(verbose);
|
res = mbedtls_ctr_drbg_self_test(verbose);
|
||||||
if (res) TestFail = true;
|
if (res) TestFail = true;
|
||||||
|
|
|
@ -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
|
{"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
|
{"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
|
{"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
|
{NULL, NULL, NULL, NULL, {0, 0, 0, 0, 0}} // Must null terminate array
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
@ -195,7 +195,7 @@ static bool checkValidCmdByte(uint8_t *cmd, uint16_t n) {
|
||||||
static void *brute_thread(void *arguments) {
|
static void *brute_thread(void *arguments) {
|
||||||
|
|
||||||
struct thread_args *args = (struct thread_args *) 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];
|
uint8_t local_enc[args->enc_len];
|
||||||
memcpy(local_enc, args->enc, args->enc_len);
|
memcpy(local_enc, args->enc, args->enc_len);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue