From 2a0d1557e1e9ef3aca759aa26b886a82014a10d4 Mon Sep 17 00:00:00 2001 From: iceman1001 Date: Tue, 7 Jan 2020 22:18:27 +0100 Subject: [PATCH] style --- client/cmdparser.c | 6 +++--- client/emv/crypto_polarssl.c | 2 +- client/fileutils.c | 12 ++++++------ common/generator.c | 6 +++--- 4 files changed, 13 insertions(+), 13 deletions(-) diff --git a/client/cmdparser.c b/client/cmdparser.c index 3f9412374..fca6fb772 100644 --- a/client/cmdparser.c +++ b/client/cmdparser.c @@ -178,7 +178,7 @@ int CmdsParse(const command_t Commands[], const char *Cmd) { char cmd_name[128]; memset(cmd_name, 0, sizeof(cmd_name)); - int len = 0; + int len = 0; // %n == receives an integer of value equal to the number of chars read so far. // len = max 127 sscanf(Cmd, "%127s%n", cmd_name, &len); @@ -248,10 +248,10 @@ void dumpCommandsRecursive(const command_t cmds[], int markdown) { } while (cmds[i].Name) { - + if ((cmds[i].Name[0] == '-' || strlen(cmds[i].Name) == 0) && ++i) continue; if (cmds[i].Help[0] == '{' && ++i) continue; - + const char *cmd_offline = "N"; if (cmds[i].IsAvailable()) diff --git a/client/emv/crypto_polarssl.c b/client/emv/crypto_polarssl.c index b0cb59baa..e258f1bbb 100644 --- a/client/emv/crypto_polarssl.c +++ b/client/emv/crypto_polarssl.c @@ -136,7 +136,7 @@ static struct crypto_pk *crypto_pk_polarssl_open_priv_rsa(va_list vl) { mbedtls_mpi_read_binary(&cp->ctx.Q, (const unsigned char *)q, qlen); mbedtls_mpi_read_binary(&cp->ctx.DP, (const unsigned char *)dp, dplen); mbedtls_mpi_read_binary(&cp->ctx.DQ, (const unsigned char *)dq, dqlen); - + int res = mbedtls_mpi_inv_mod(&cp->ctx.QP, &cp->ctx.Q, &cp->ctx.P); if (res != 0) { fprintf(stderr, "PolarSSL private key error res=%x exp=%d mod=%d.\n", res * -1, explen, modlen); diff --git a/client/fileutils.c b/client/fileutils.c index 17b3da4bf..4847d52b8 100644 --- a/client/fileutils.c +++ b/client/fileutils.c @@ -204,7 +204,7 @@ int saveFileEML(const char *preferredName, uint8_t *data, size_t datalen, size_t } fflush(f); fclose(f); - PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32 )" blocks to text file " _YELLOW_("%s"), blocks, fileName); + PrintAndLogEx(SUCCESS, "saved " _YELLOW_("%" PRId32)" blocks to text file " _YELLOW_("%s"), blocks, fileName); out: free(fileName); @@ -618,7 +618,7 @@ int loadFile_safe(const char *preferredName, const char *suffix, void **pdata, s int loadFileEML(const char *preferredName, void *data, size_t *datalen) { if (data == NULL) return PM3_EINVARG; - + char *fileName = filenamemcopy(preferredName, ".eml"); if (fileName == NULL) return PM3_EMALLOC; @@ -637,7 +637,7 @@ int loadFileEML(const char *preferredName, void *data, size_t *datalen) { memset(line, 0, sizeof(line)); uint8_t buf[64] = {0x00}; - uint8_t *udata = (uint8_t*)data; + uint8_t *udata = (uint8_t *)data; while (!feof(f)) { @@ -861,15 +861,15 @@ int loadFileDICTIONARYEx(const char *preferredName, void *data, size_t maxdatale } if (startFilePosition) { - if (fseek(f, startFilePosition, SEEK_SET) < 0){ + if (fseek(f, startFilePosition, SEEK_SET) < 0) { fclose(f); retval = PM3_EFILE; goto out; } } - uint8_t *udata = (uint8_t*)data; - + uint8_t *udata = (uint8_t *)data; + // read file while (!feof(f)) { size_t filepos = ftell(f); diff --git a/common/generator.c b/common/generator.c index f2bf33626..174657573 100644 --- a/common/generator.c +++ b/common/generator.c @@ -26,7 +26,7 @@ //------------------------------------ // MFU/NTAG PWD/PACK generation stuff -// Italian transport system +// Italian transport system // Amiibo // Lego Dimension // XYZ 3D printing @@ -225,9 +225,9 @@ int mfc_algo_mizip_one(uint8_t *uid, uint8_t sector, uint64_t *key) { } // returns all Mifare Mini (MFM) 10 keys. // keys must have 5*2*6 = 60bytes space -int mfc_algo_mizip_all(uint8_t *uid, uint8_t *keys) { +int mfc_algo_mizip_all(uint8_t *uid, uint8_t *keys) { if (keys == NULL) return PM3_EINVARG; - + uint64_t xor_tbl[] = { 0x09125a2589e5ULL, 0xF12C8453D821ULL, 0xAB75C937922FULL, 0x73E799FE3241ULL,