diff --git a/client/deps/hardnested/hardnested_bf_core.c b/client/deps/hardnested/hardnested_bf_core.c index 0f2d57f16..1fa7626e4 100644 --- a/client/deps/hardnested/hardnested_bf_core.c +++ b/client/deps/hardnested/hardnested_bf_core.c @@ -610,7 +610,8 @@ uint64_t crack_states_bitsliced_dispatch(uint32_t cuid, uint8_t *best_first_byte break; #endif #endif - default: + case SIMD_AUTO: + case SIMD_NONE: crack_states_bitsliced_function_p = &crack_states_bitsliced_NOSIMD; break; } @@ -642,7 +643,8 @@ void bitslice_test_nonces_dispatch(uint32_t nonces_to_bruteforce, uint32_t *bf_t break; #endif #endif - default: + case SIMD_AUTO: + case SIMD_NONE: bitslice_test_nonces_function_p = &bitslice_test_nonces_NOSIMD; break; } diff --git a/client/deps/jansson/Makefile b/client/deps/jansson/Makefile index 487a85af8..5073b78a1 100644 --- a/client/deps/jansson/Makefile +++ b/client/deps/jansson/Makefile @@ -1,6 +1,6 @@ MYSRCPATHS = MYINCLUDES = -I. -MYCFLAGS = -Wno-unused-function -Wno-cast-align -Wno-bad-function-cast +MYCFLAGS = -Wno-unused-function -Wno-cast-align -Wno-bad-function-cast -Wno-switch-enum MYDEFS = -DHAVE_STDINT_H MYSRCS = \ dump.c \ diff --git a/client/deps/liblua/Makefile b/client/deps/liblua/Makefile index 296fd9e24..e2cf7baa3 100644 --- a/client/deps/liblua/Makefile +++ b/client/deps/liblua/Makefile @@ -1,7 +1,7 @@ MYSRCPATHS = MYINCLUDES = -I. # Lua lib requires GNU extensions (implicit declarations of functions): -std=gnu99 or -std=gnu11 -MYCFLAGS = -Wno-cast-align -Wno-bad-function-cast +MYCFLAGS = -Wno-cast-align -Wno-bad-function-cast -Wno-switch-enum MYDEFS = -DLUA_COMPAT_ALL $(SYSCFLAGS) MYSRCS = lapi.c lcode.c lctype.c ldebug.c ldo.c ldump.c lfunc.c lgc.c llex.c \ lmem.c lobject.c lopcodes.c lparser.c lstate.c lstring.c ltable.c \ diff --git a/client/src/cmdhficlass.c b/client/src/cmdhficlass.c index e46f045a3..b277820e2 100644 --- a/client/src/cmdhficlass.c +++ b/client/src/cmdhficlass.c @@ -775,7 +775,7 @@ static int CmdHFiClassELoad(const char *Cmd) { res = loadFileJSON(filename, dump, 2048, &bytes_read); break; } - default: + case DICTIONARY: PrintAndLogEx(ERR, "No dictionary loaded"); free(dump); return PM3_ESOFT; diff --git a/client/src/cmdhfmfhard.c b/client/src/cmdhfmfhard.c index 0e421a80a..f01f43fae 100644 --- a/client/src/cmdhfmfhard.c +++ b/client/src/cmdhfmfhard.c @@ -90,7 +90,8 @@ static void get_SIMD_instruction_set(char *instruction_set) { case SIMD_MMX: strcpy(instruction_set, "MMX"); break; - default: + case SIMD_AUTO: + case SIMD_NONE: strcpy(instruction_set, "no"); break; } diff --git a/client/src/cmdlfhitag.c b/client/src/cmdlfhitag.c index 4c35fedf1..5a11216fb 100644 --- a/client/src/cmdlfhitag.c +++ b/client/src/cmdlfhitag.c @@ -572,10 +572,12 @@ static int CmdLFHitagReader(const char *Cmd) { // No additional parameters needed break; } + case RHT1F_PLAIN: + case RHT1F_AUTHENTICATE: case WHTSF_CHALLENGE: case WHTSF_KEY: + case WHT2F_PASSWORD: case WHT2F_CRYPTO: - default: return usage_hitag_reader(); } @@ -678,6 +680,8 @@ static int CmdLFHitagWriter(const char *Cmd) { num_to_bytes(param_get32ex(Cmd, 3, 0, 16), 4, htd.crypto.data); break; } + case RHT1F_PLAIN: + case RHT1F_AUTHENTICATE: case RHTSF_CHALLENGE: case RHTSF_KEY: case RHT2F_PASSWORD: @@ -685,7 +689,6 @@ static int CmdLFHitagWriter(const char *Cmd) { case RHT2F_CRYPTO: case RHT2F_TEST_AUTH_ATTEMPTS: case RHT2F_UID_ONLY: - default: return usage_hitag_writer(); } diff --git a/client/src/emv/crypto_polarssl.c b/client/src/emv/crypto_polarssl.c index e258f1bbb..9d18a370b 100644 --- a/client/src/emv/crypto_polarssl.c +++ b/client/src/emv/crypto_polarssl.c @@ -156,7 +156,7 @@ static struct crypto_pk *crypto_pk_polarssl_open_priv_rsa(va_list vl) { static int myrand(void *rng_state, unsigned char *output, size_t len) { size_t i; - rng_state = NULL; + (void)rng_state; for (i = 0; i < len; ++i) output[i] = rand(); diff --git a/client/src/ui.c b/client/src/ui.c index ce3c528f4..9414fbb34 100644 --- a/client/src/ui.c +++ b/client/src/ui.c @@ -424,10 +424,13 @@ static bool emojify_token(const char *token, uint8_t token_length, const char ** } break; } - default: {// ERASE + case ERASE: { *emojified_token_length = 0; break; } + case ALIAS: { // should never happen + return false; + } } return true; } diff --git a/common/legic_prng.c b/common/legic_prng.c index 8646f55a9..1447d3b1b 100644 --- a/common/legic_prng.c +++ b/common/legic_prng.c @@ -46,7 +46,7 @@ void legic_prng_forward(int count) { } } -uint8_t legic_prng_get_bit() { +uint8_t legic_prng_get_bit(void) { uint8_t idx = 7 - ((lfsr.a & 4) | (lfsr.a >> 2 & 2) | (lfsr.a >> 4 & 1)); return lfsr.b >> idx & 1; } diff --git a/common/mbedtls/Makefile b/common/mbedtls/Makefile index 880f6bcc8..4ae8357b3 100644 --- a/common/mbedtls/Makefile +++ b/common/mbedtls/Makefile @@ -1,6 +1,6 @@ MYSRCPATHS = MYINCLUDES = -I. -I.. -MYCFLAGS = -Wno-cast-align +MYCFLAGS = -Wno-cast-align -Wno-switch-enum MYDEFS = MYSRCS = \ aes.c \ diff --git a/common/zlib/Makefile b/common/zlib/Makefile index baec1eb1e..2f68e0ea2 100644 --- a/common/zlib/Makefile +++ b/common/zlib/Makefile @@ -1,7 +1,7 @@ MYSRCPATHS = ../../common/zlib MYSRCS = deflate.c adler32.c trees.c zutil.c inflate.c inffast.c inftrees.c MYINCLUDES = -I../../common/zlib -MYCFLAGS = -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations +MYCFLAGS = -Wno-strict-prototypes -Wno-missing-prototypes -Wno-missing-declarations -Wno-old-style-definition -Wno-implicit-fallthrough MYDEFS = -DZ_SOLO -DNO_GZIP -DZLIB_PM3_TUNED #-DDEBUG -Dverbose=1