make style

This commit is contained in:
Philippe Teuwen 2021-05-18 23:56:11 +02:00
commit a592b349cb
6 changed files with 25 additions and 25 deletions

View file

@ -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

View file

@ -1893,7 +1893,7 @@ static int handler_desfire_readdata(mfdes_data_t *data, MFDES_FILE_TYPE_T type,
// 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);
@ -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) {

View file

@ -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);

View file

@ -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;