summaryrefslogtreecommitdiff
path: root/tests/priorities.c
diff options
context:
space:
mode:
authorNikos Mavrogiannopoulos <nmav@gnutls.org>2017-03-07 07:55:10 +0100
committerNikos Mavrogiannopoulos <nmav@redhat.com>2017-03-07 11:45:13 +0100
commit12ab4f725d605130a7719a687981d9d1d3e6337f (patch)
tree3d8ba213ef007b4f02286caa3e42234b202bbabc /tests/priorities.c
parent603772688c4e37dae437b4cede12e25b9dd9f678 (diff)
downloadgnutls-12ab4f725d605130a7719a687981d9d1d3e6337f.tar.gz
tests: converted compile-time checks for FIPS140 mode to run-timetmp-use-thread-local-rng
This allows running the complete test suite even when the library is compiled in FIPS140-2 mode, as long as the run-time is not at this mode. Signed-off-by: Nikos Mavrogiannopoulos <nmav@gnutls.org>
Diffstat (limited to 'tests/priorities.c')
-rw-r--r--tests/priorities.c18
1 files changed, 9 insertions, 9 deletions
diff --git a/tests/priorities.c b/tests/priorities.c
index b1b5d40428..f0eb7b7570 100644
--- a/tests/priorities.c
+++ b/tests/priorities.c
@@ -101,7 +101,6 @@ void doit(void)
int normal_ciphers = 11;
int pfs_cs = 39;
-#ifdef ENABLE_FIPS140
if (gnutls_fips140_mode_enabled()) {
normal_cs = 30;
normal_ciphers = 6;
@@ -109,17 +108,18 @@ void doit(void)
sec256_cs = 11;
sec128_cs = 30;
}
-#endif
try_prio("NORMAL", normal_cs, normal_ciphers, __LINE__);
try_prio("NORMAL:-MAC-ALL:+MD5:+MAC-ALL", normal_cs, normal_ciphers, __LINE__);
-#ifndef ENABLE_FIPS140
- try_prio("PFS", pfs_cs, normal_ciphers, __LINE__);
- try_prio("NORMAL:+CIPHER-ALL", normal_cs, 11, __LINE__); /* all (except null) */
- try_prio("NORMAL:-CIPHER-ALL:+NULL", null, 1, __LINE__); /* null */
- try_prio("NORMAL:-CIPHER-ALL:+NULL:+CIPHER-ALL", normal_cs + null, 12, __LINE__); /* should be null + all */
- try_prio("NORMAL:-CIPHER-ALL:+NULL:+CIPHER-ALL:-CIPHER-ALL:+AES-128-CBC", 8, 1, __LINE__); /* should be null + all */
-#endif
+
+ if (!gnutls_fips140_mode_enabled()) {
+ try_prio("PFS", pfs_cs, normal_ciphers, __LINE__);
+ try_prio("NORMAL:+CIPHER-ALL", normal_cs, 11, __LINE__); /* all (except null) */
+ try_prio("NORMAL:-CIPHER-ALL:+NULL", null, 1, __LINE__); /* null */
+ try_prio("NORMAL:-CIPHER-ALL:+NULL:+CIPHER-ALL", normal_cs + null, 12, __LINE__); /* should be null + all */
+ try_prio("NORMAL:-CIPHER-ALL:+NULL:+CIPHER-ALL:-CIPHER-ALL:+AES-128-CBC", 8, 1, __LINE__); /* should be null + all */
+ }
+
try_prio("PERFORMANCE", normal_cs, normal_ciphers, __LINE__);
try_prio("SECURE256", sec256_cs, 6, __LINE__);
try_prio("SECURE128", sec128_cs, 11, __LINE__);