stricter warnings, wip

This commit is contained in:
Philippe Teuwen
2020-05-03 01:13:28 +02:00
parent 9358554884
commit 3529aea157
43 changed files with 140 additions and 142 deletions

View File

@@ -283,7 +283,7 @@ void doMAC_N(uint8_t *address_data_p, uint8_t address_data_size, uint8_t *div_ke
}
#ifndef ON_DEVICE
int testMAC() {
int testMAC(void) {
PrintAndLogEx(SUCCESS, "Testing MAC calculation...");
//From the "dismantling.IClass" paper:

View File

@@ -190,7 +190,7 @@ void printarr_human_readable(const char *title, uint8_t *arr, int len) {
//-----------------------------
#ifndef ON_DEVICE
static int testBitStream() {
static int testBitStream(void) {
uint8_t input [] = {0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD, 0xBE, 0xEF};
uint8_t output [] = {0, 0, 0, 0, 0, 0, 0, 0};
BitstreamIn in = { input, sizeof(input) * 8, 0};
@@ -215,7 +215,7 @@ static int testBitStream() {
return PM3_SUCCESS;
}
static int testReversedBitstream() {
static int testReversedBitstream(void) {
uint8_t input [] = {0xDE, 0xAD, 0xBE, 0xEF, 0xDE, 0xAD, 0xBE, 0xEF};
uint8_t reverse [] = {0, 0, 0, 0, 0, 0, 0, 0};
uint8_t output [] = {0, 0, 0, 0, 0, 0, 0, 0};

View File

@@ -568,7 +568,7 @@ int bruteforceFileNoKeys(const char *filename) {
// ----------------------------------------------------------------------------
// TEST CODE BELOW
// ----------------------------------------------------------------------------
static int _testBruteforce() {
static int _testBruteforce(void) {
PrintAndLogEx(INFO, "Testing crack from dumpfile...");
@@ -596,7 +596,7 @@ static int _testBruteforce() {
return errors;
}
static int _test_iclass_key_permutation() {
static int _test_iclass_key_permutation(void) {
uint8_t testcase[8] = {0x6c, 0x8d, 0x44, 0xf9, 0x2a, 0x2d, 0x01, 0xbf};
uint8_t testcase_output[8] = {0};
uint8_t testcase_output_correct[8] = {0x8a, 0x0d, 0xb9, 0x88, 0xbb, 0xa7, 0x90, 0xea};
@@ -622,7 +622,7 @@ static int _test_iclass_key_permutation() {
return 0;
}
static int _testHash1() {
static int _testHash1(void) {
uint8_t expected[8] = {0x7E, 0x72, 0x2F, 0x40, 0x2D, 0x02, 0x51, 0x42};
uint8_t csn[8] = {0x01, 0x02, 0x03, 0x04, 0xF7, 0xFF, 0x12, 0xE0};
uint8_t k[8] = {0};

View File

@@ -219,7 +219,7 @@ static void permute(BitstreamIn *p_in, uint64_t z, int l, int r, BitstreamOut *o
}
}
static void printbegin() {
static void printbegin(void) {
if (debug_print < 2)
return;
@@ -369,7 +369,7 @@ void diversifyKey(uint8_t csn[8], uint8_t key[8], uint8_t div_key[8]) {
hash0(crypt_csn, div_key);
}
/*
static void testPermute() {
static void testPermute(void) {
uint64_t x = 0;
pushbackSixBitByte(&x, 0x00, 0);
pushbackSixBitByte(&x, 0x01, 1);
@@ -555,7 +555,7 @@ Testcase testcases[] = {
{{0}, {0}, {0}}
};
static int testKeyDiversificationWithMasterkeyTestcases() {
static int testKeyDiversificationWithMasterkeyTestcases(void) {
int i, error = 0;
uint8_t empty[8] = {0};
@@ -630,7 +630,7 @@ static int testDES2(uint64_t csn, uint64_t expected) {
* @brief doTestsWithKnownInputs
* @return
*/
static int doTestsWithKnownInputs() {
static int doTestsWithKnownInputs(void) {
// KSel from http://www.proxmark.org/forum/viewtopic.php?pid=10977#p10977
int errors = 0;
PrintAndLogEx(SUCCESS, "Testing DES encryption");