make style

This commit is contained in:
merlokk 2021-07-20 21:20:55 +03:00
commit 10362d68cf
2 changed files with 11 additions and 11 deletions

View file

@ -4913,7 +4913,7 @@ static int CmdHF14ADesSetConfiguration(const char *Cmd) {
bool APDULogging = arg_get_lit(ctx, 1); bool APDULogging = arg_get_lit(ctx, 1);
bool verbose = arg_get_lit(ctx, 2); bool verbose = arg_get_lit(ctx, 2);
DesfireContext dctx; DesfireContext dctx;
int securechann = defaultSecureChannel; int securechann = defaultSecureChannel;
uint32_t appid = 0x000000; uint32_t appid = 0x000000;
@ -4922,7 +4922,7 @@ static int CmdHF14ADesSetConfiguration(const char *Cmd) {
CLIParserFree(ctx); CLIParserFree(ctx);
return res; return res;
} }
uint32_t paramid = 0; uint32_t paramid = 0;
res = arg_get_u32_hexstr_def_nlen(ctx, 12, 0, &paramid, 1, true); res = arg_get_u32_hexstr_def_nlen(ctx, 12, 0, &paramid, 1, true);
if (res == 2) { if (res == 2) {
@ -4930,7 +4930,7 @@ static int CmdHF14ADesSetConfiguration(const char *Cmd) {
CLIParserFree(ctx); CLIParserFree(ctx);
return PM3_EINVARG; return PM3_EINVARG;
} }
uint8_t param[250] = {0}; uint8_t param[250] = {0};
int paramlen = sizeof(param); int paramlen = sizeof(param);
CLIGetHexWithReturn(ctx, 13, param, &paramlen); CLIGetHexWithReturn(ctx, 13, param, &paramlen);
@ -4942,7 +4942,7 @@ static int CmdHF14ADesSetConfiguration(const char *Cmd) {
PrintAndLogEx(ERR, "Parameter data length must be less than 50 instead of %d.", paramlen); PrintAndLogEx(ERR, "Parameter data length must be less than 50 instead of %d.", paramlen);
return PM3_EINVARG; return PM3_EINVARG;
} }
SetAPDULogging(APDULogging); SetAPDULogging(APDULogging);
CLIParserFree(ctx); CLIParserFree(ctx);
@ -4952,7 +4952,7 @@ static int CmdHF14ADesSetConfiguration(const char *Cmd) {
else else
PrintAndLogEx(INFO, _CYAN_("Application %06x") " param ID: 0x%02x param[%d]: %s", appid, paramid, paramlen, sprint_hex(param, paramlen)); PrintAndLogEx(INFO, _CYAN_("Application %06x") " param ID: 0x%02x param[%d]: %s", appid, paramid, paramlen, sprint_hex(param, paramlen));
} }
res = DesfireSelectAndAuthenticate(&dctx, securechann, appid, verbose); res = DesfireSelectAndAuthenticate(&dctx, securechann, appid, verbose);
if (res != PM3_SUCCESS) { if (res != PM3_SUCCESS) {
DropField(); DropField();

View file

@ -1108,7 +1108,7 @@ int DesfireChangeKey(DesfireContext *dctx, bool change_master_key, uint8_t newke
uint8_t pckcdata[DESFIRE_MAX_KEY_SIZE + 10] = {0}; uint8_t pckcdata[DESFIRE_MAX_KEY_SIZE + 10] = {0};
uint8_t *cdata = &pckcdata[2]; uint8_t *cdata = &pckcdata[2];
uint8_t keynodata = newkeynum & 0x3f; uint8_t keynodata = newkeynum & 0x3f;
/* /*
* Because new crypto methods can be setup only at application creation, * Because new crypto methods can be setup only at application creation,
* changing the card master key to one of them require a key_no tweak. * changing the card master key to one of them require a key_no tweak.
@ -1116,7 +1116,7 @@ int DesfireChangeKey(DesfireContext *dctx, bool change_master_key, uint8_t newke
if (change_master_key) { if (change_master_key) {
keynodata |= (DesfireKeyAlgoToType(newkeytype) & 0x03) << 6; keynodata |= (DesfireKeyAlgoToType(newkeytype) & 0x03) << 6;
} }
pckcdata[0] = MFDES_CHANGE_KEY; // TODO pckcdata[0] = MFDES_CHANGE_KEY; // TODO
pckcdata[1] = keynodata; pckcdata[1] = keynodata;
@ -1206,13 +1206,13 @@ int DesfireSetConfiguration(DesfireContext *dctx, uint8_t paramid, uint8_t *para
desfire_crc32_append(cdata, datalen + 1); desfire_crc32_append(cdata, datalen + 1);
datalen += 4; datalen += 4;
} }
// dynamic length // dynamic length
if (paramid == 0x02) { if (paramid == 0x02) {
data[datalen] = 0x80; data[datalen] = 0x80;
datalen++; datalen++;
} }
// send command // send command
uint8_t resp[257] = {0}; uint8_t resp[257] = {0};
size_t resplen = 0; size_t resplen = 0;
@ -1221,6 +1221,6 @@ int DesfireSetConfiguration(DesfireContext *dctx, uint8_t paramid, uint8_t *para
// check response // check response
if (res == 0 && resplen > 0) if (res == 0 && resplen > 0)
res = -20; res = -20;
return res; return res;
} }