Further improvements to hashing code to make sure wc_*Free is always called including wc_HashFree. Added new defines to disable PIC32MZ hardware features using NO_PIC32MZ_HASH, NO_PIC32MZ_RNG and NO_PIC32MZ_CRYPT.

This commit is contained in:
David Garske
2018-07-25 15:04:26 -07:00
parent 92cb8f06ea
commit efbabbfb29
10 changed files with 167 additions and 185 deletions

View File

@@ -5277,6 +5277,7 @@ static int test_wc_Sha3_224_Final (void)
ret = WOLFSSL_FATAL_ERROR;
}
}
wc_Sha3_224_Free(&sha3);
printf(resultFmt, ret == 0 ? passed : failed);
if (ret == 0) {
@@ -5370,7 +5371,9 @@ static int test_wc_Sha3_256_Final (void)
ret = WOLFSSL_FATAL_ERROR;
}
}
wc_Sha3_256_Free(&sha3);
printf(resultFmt, ret == 0 ? passed : failed);
if (ret == 0) {
printf(testingFmt, "wc_Sha3_256_GetHash()");
@@ -5461,7 +5464,9 @@ static int test_wc_Sha3_384_Final (void)
ret = WOLFSSL_FATAL_ERROR;
}
}
wc_Sha3_384_Free(&sha3);
printf(resultFmt, ret == 0 ? passed : failed);
if (ret == 0) {
printf(testingFmt, "wc_Sha3_384_GetHash()");
@@ -5554,7 +5559,9 @@ static int test_wc_Sha3_512_Final (void)
ret = WOLFSSL_FATAL_ERROR;
}
}
wc_Sha3_512_Free(&sha3);
printf(resultFmt, ret == 0 ? passed : failed);
if (ret == 0) {
printf(testingFmt, "wc_Sha3_512_GetHash()");
@@ -15390,6 +15397,8 @@ static int test_wc_HashInit(void)
ret = 1;
break;
}
wc_HashFree(&hash, enumArray[i]);
/* check for null ptr */
if (wc_HashInit(NULL, enumArray[i]) != BAD_FUNC_ARG) {
ret = 1;