diff --git a/client/cmdhficlass.c b/client/cmdhficlass.c index 0c9d67d6e..368aaad2e 100644 --- a/client/cmdhficlass.c +++ b/client/cmdhficlass.c @@ -766,7 +766,7 @@ int CmdHFiClassDecrypt(const char *Cmd) { hdr->csn[4],hdr->csn[5],hdr->csn[6],hdr->csn[7]); // tripledes - mbedtls_des3_context ctx = { 0 }; + mbedtls_des3_context ctx; mbedtls_des3_set2key_dec( &ctx, key); uint8_t enc_dump[8] = {0}; @@ -797,7 +797,7 @@ static int iClassEncryptBlkData(uint8_t *blkData) { PrintAndLogEx(SUCCESS, "decryption file found"); uint8_t encryptedData[16]; uint8_t *encrypted = encryptedData; - mbedtls_des3_context ctx = { 0 }; + mbedtls_des3_context ctx; mbedtls_des3_set2key_enc( &ctx, key); mbedtls_des3_crypt_ecb(&ctx, blkData,encrypted); diff --git a/client/cmdhfmfu.c b/client/cmdhfmfu.c index 72c4be573..327069971 100644 --- a/client/cmdhfmfu.c +++ b/client/cmdhfmfu.c @@ -2392,10 +2392,10 @@ int CmdHF14AMfucSetUid(const char *Cmd){ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){ uint8_t uid[4]; - char cmdp = param_getchar(Cmd, 0); - if (strlen(Cmd) == 0 || cmdp == 'h' || cmdp == 'H') return usage_hf_mfu_gendiverse(); + char cmdp = tolower(param_getchar(Cmd, 0)); + if (strlen(Cmd) == 0 || cmdp == 'h') return usage_hf_mfu_gendiverse(); - if ( cmdp == 'r' || cmdp == 'R') { + if ( cmdp == 'r' ) { // read uid from tag UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0}}; clearCommandBuffer(); @@ -2441,7 +2441,7 @@ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){ mix[6] = block ^ uid[2]; mix[7] = uid[3]; - mbedtls_des3_context ctx = { 0x00 }; + mbedtls_des3_context ctx; mbedtls_des3_set2key_enc(&ctx, masterkey); mbedtls_des3_crypt_cbc(&ctx // des3_context @@ -2501,11 +2501,11 @@ int CmdHF14AMfuGenDiverseKeys(const char *Cmd){ int CmdHF14AMfuPwdGen(const char *Cmd){ uint8_t uid[7] = {0x00}; - char cmdp = param_getchar(Cmd, 0); - if (strlen(Cmd) == 0 || cmdp == 'h' || cmdp == 'H') return usage_hf_mfu_pwdgen(); - if (cmdp == 't' || cmdp == 'T') return ul_ev1_pwdgen_selftest(); + char cmdp = tolower(param_getchar(Cmd, 0)); + if (strlen(Cmd) == 0 || cmdp == 'h') return usage_hf_mfu_pwdgen(); + if (cmdp == 't') return ul_ev1_pwdgen_selftest(); - if ( cmdp == 'r' || cmdp == 'R') { + if ( cmdp == 'r') { // read uid from tag UsbCommand c = {CMD_READER_ISO_14443a, {ISO14A_CONNECT | ISO14A_NO_RATS, 0, 0}}; clearCommandBuffer();