Merge pull request #1639 from ejohnstown/selftest-fixes

netbsd-selftest fix
This commit is contained in:
Chris Conlon
2018-06-26 15:38:03 -06:00
committed by GitHub

View File

@@ -6932,7 +6932,7 @@ int aesgcm_test(void)
#if !defined(HAVE_FIPS) || \ #if !defined(HAVE_FIPS) || \
(defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2)) (defined(HAVE_FIPS_VERSION) && (HAVE_FIPS_VERSION >= 2))
/* Test encrypt with internally generated IV */ /* Test encrypt with internally generated IV */
#ifndef WC_NO_RNG #if !(defined(WC_NO_RNG) || defined(HAVE_SELFTEST))
{ {
WC_RNG rng; WC_RNG rng;
byte randIV[12]; byte randIV[12];
@@ -6986,7 +6986,7 @@ int aesgcm_test(void)
return -8212; return -8212;
wc_FreeRng(&rng); wc_FreeRng(&rng);
} }
#endif /* WC_NO_RNG */ #endif /* WC_NO_RNG HAVE_SELFTEST */
#endif #endif
wc_AesFree(&enc); wc_AesFree(&enc);
@@ -7063,7 +7063,7 @@ int gmac_test(void)
if (XMEMCMP(t2, tag, sizeof(t2)) != 0) if (XMEMCMP(t2, tag, sizeof(t2)) != 0)
return -5801; return -5801;
#ifndef WC_NO_RNG #if !(defined(WC_NO_RNG) || defined(HAVE_SELFTEST))
{ {
const byte badT[] = const byte badT[] =
{ {
@@ -7102,7 +7102,7 @@ int gmac_test(void)
return -8219; return -8219;
wc_FreeRng(&rng); wc_FreeRng(&rng);
} }
#endif /* WC_NO_RNG */ #endif /* WC_NO_RNG HAVE_SELFTEST */
#endif /* HAVE_FIPS */ #endif /* HAVE_FIPS */
return 0; return 0;
@@ -11310,6 +11310,7 @@ static int dh_fips_generate_test(WC_RNG *rng)
ERROR_OUT(-7088, exit_gen_test); ERROR_OUT(-7088, exit_gen_test);
} }
#ifndef HAVE_SELFTEST
ret = wc_DhCheckKeyPair(&key, pub, pubSz, priv, privSz); ret = wc_DhCheckKeyPair(&key, pub, pubSz, priv, privSz);
if (ret != 0) { if (ret != 0) {
ERROR_OUT(-8229, exit_gen_test); ERROR_OUT(-8229, exit_gen_test);
@@ -11321,6 +11322,7 @@ static int dh_fips_generate_test(WC_RNG *rng)
if (ret != MP_CMP_E) { if (ret != MP_CMP_E) {
ERROR_OUT(-8230, exit_gen_test); ERROR_OUT(-8230, exit_gen_test);
} }
#endif /* HAVE_SELFTEST */
#ifdef WOLFSSL_KEY_GEN #ifdef WOLFSSL_KEY_GEN