From: pwpiwi Date: Thu, 6 Dec 2018 06:53:25 +0000 (+0100) Subject: Change mbedtls initializers to be compatible with older versions of gcc (#732) X-Git-Url: http://cvs.zerfleddert.de/cgi-bin/gitweb.cgi/proxmark3-svn/commitdiff_plain/aa0b1c431f5f1562041a27c06d61f54c14fe4b02 Change mbedtls initializers to be compatible with older versions of gcc (#732) * fix issue #731 --- diff --git a/armsrc/mifareutil.c b/armsrc/mifareutil.c index 4b1f16f3..ab04aee4 100644 --- a/armsrc/mifareutil.c +++ b/armsrc/mifareutil.c @@ -296,7 +296,7 @@ int mifare_ultra_auth(uint8_t *keybytes){ /// 3des2k - mbedtls_des3_context ctx = { 0x00 }; + mbedtls_des3_context ctx = { {0} }; uint8_t random_a[8] = {1,1,1,1,1,1,1,1}; uint8_t random_b[8] = {0x00}; uint8_t enc_random_b[8] = {0x00}; diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index c97e433c..55804cf8 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -414,7 +414,7 @@ int CmdHFiClassDecrypt(const char *Cmd) { fseek(f, 0, SEEK_SET); uint8_t enc_dump[8] = {0}; uint8_t *decrypted = malloc(fsize); - mbedtls_des3_context ctx = { 0 }; + mbedtls_des3_context ctx = { {0} }; mbedtls_des3_set2key_dec( &ctx, key); size_t bytes_read = fread(enc_dump, 1, 8, f); @@ -466,7 +466,7 @@ static int iClassEncryptBlkData(uint8_t *blkData) { uint8_t encryptedData[16]; uint8_t *encrypted = encryptedData; - mbedtls_des3_context ctx = { 0 }; + mbedtls_des3_context ctx = { {0} }; mbedtls_des3_set2key_enc( &ctx, key); mbedtls_des3_crypt_ecb(&ctx, blkData,encrypted); diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index f167bae5..c3442ee3 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -1742,7 +1742,7 @@ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){ mix[6] = block ^ uid[2]; mix[7] = uid[3]; - mbedtls_des3_context ctx = { 0x00 }; + mbedtls_des3_context ctx = { {0} }; mbedtls_des3_set2key_enc(&ctx, masterkey); mbedtls_des3_crypt_cbc(&ctx // des3_context diff --git a/client/loclass/elite_crack.c b/client/loclass/elite_crack.c index f45c55b5..0cd00830 100644 --- a/client/loclass/elite_crack.c +++ b/client/loclass/elite_crack.c @@ -179,8 +179,8 @@ void rk(uint8_t *key, uint8_t n, uint8_t *outp_key) return; } -static mbedtls_des_context ctx_enc = {0}; -static mbedtls_des_context ctx_dec = {0}; +static mbedtls_des_context ctx_enc = { {0} }; +static mbedtls_des_context ctx_dec = { {0} }; void desdecrypt_iclass(uint8_t *iclass_key, uint8_t *input, uint8_t *output) { @@ -449,7 +449,7 @@ int bruteforceItem(dumpdata item, uint16_t keytable[]) */ int calculateMasterKey(uint8_t first16bytes[], uint64_t master_key[] ) { - mbedtls_des_context ctx_e = {0}; + mbedtls_des_context ctx_e = { {0} }; uint8_t z_0[8] = {0}; uint8_t y_0[8] = {0}; diff --git a/client/loclass/ikeys.c b/client/loclass/ikeys.c index 3f90d6ee..a40d563a 100644 --- a/client/loclass/ikeys.c +++ b/client/loclass/ikeys.c @@ -72,8 +72,8 @@ From "Dismantling iclass": uint8_t pi[35] = {0x0F,0x17,0x1B,0x1D,0x1E,0x27,0x2B,0x2D,0x2E,0x33,0x35,0x39,0x36,0x3A,0x3C,0x47,0x4B,0x4D,0x4E,0x53,0x55,0x56,0x59,0x5A,0x5C,0x63,0x65,0x66,0x69,0x6A,0x6C,0x71,0x72,0x74,0x78}; -static mbedtls_des_context ctx_enc = {0}; -static mbedtls_des_context ctx_dec = {0}; +static mbedtls_des_context ctx_enc = { {0} }; +static mbedtls_des_context ctx_dec = { {0} }; static int debug_print = 0;