]> git.ipfire.org Git - thirdparty/gnutls.git/commitdiff
Restrict the number of tests run on FIPS140-2 mode.
authorNikos Mavrogiannopoulos <nmav@redhat.com>
Fri, 22 Nov 2013 11:12:57 +0000 (12:12 +0100)
committerNikos Mavrogiannopoulos <nmav@redhat.com>
Wed, 27 Nov 2013 10:41:44 +0000 (11:41 +0100)
tests/mini-overhead.c
tests/mini-record-2.c
tests/mini-x509.c
tests/pkcs12-decode/Makefile.am
tests/pkcs12_encode.c
tests/priorities.c
tests/record-sizes.c
tests/set_pkcs12_cred.c

index cf5d1e19c241819fae8fb83d423f26aa5469b9e1..529c71f39190b03a3818dc308736c7f8967ccfd2 100644 (file)
@@ -335,6 +335,7 @@ void doit(void)
        start
            ("NONE:+VERS-DTLS1.0:+AES-128-GCM:+AEAD:+SIGN-ALL:+COMP-NULL:+RSA",
             37);
+#ifndef ENABLE_FIPS140
        /* 13 + 20(tag) */
        start
            ("NONE:+VERS-DTLS1.0:+SALSA20-256:+SHA1:+SIGN-ALL:+COMP-NULL:+RSA",
@@ -343,6 +344,7 @@ void doit(void)
        start
            ("NONE:+VERS-DTLS1.0:+SALSA20-256:+UMAC-96:+SIGN-ALL:+COMP-NULL:+RSA",
             25);
+#endif
 }
 
 #endif                         /* _WIN32 */
index b6104b42fbff528f9ccf786bd4231f6b31f3077d..0d27acc4a1615ce3e71fdb03778913769ce22e65 100644 (file)
@@ -377,9 +377,6 @@ void doit(void)
 {
        signal(SIGCHLD, ch_handler);
 
-       start(NULL_SHA1, 0);
-
-       start(NEW_ARCFOUR_SHA1, 1);
        start(NEW_AES_CBC, 1);
        start(NEW_AES_CBC_SHA256, 1);
        start(NEW_AES_GCM, 1);
@@ -388,8 +385,13 @@ void doit(void)
        start(AES_CBC_SHA256, 1);
        start(AES_GCM, 0);
 
+#ifndef ENABLE_FIPS140
+       start(NULL_SHA1, 0);
+       start(NEW_ARCFOUR_SHA1, 1);
+
        start(ARCFOUR_SHA1, 0);
        start(ARCFOUR_MD5, 0);
+#endif
 
        start(ARCFOUR_SHA1_ZLIB, 0);
        start(NEW_ARCFOUR_SHA1_ZLIB, 1);
index 333d544df9254aef79f0fdc8f4f1f5672f655571..edd67aa2911af483f2f34c7888a0317f037102b2 100644 (file)
@@ -107,7 +107,11 @@ void doit(void)
        gnutls_credentials_set(server, GNUTLS_CRD_CERTIFICATE,
                               serverx509cred);
        gnutls_priority_set_direct(server,
+#ifndef ENABLE_FIPS140
                                   "NORMAL:-CIPHER-ALL:+ARCFOUR-128",
+#else
+                                  "NORMAL:-CIPHER-ALL:+AES-128-CBC",
+#endif
                                   NULL);
        gnutls_transport_set_push_function(server, server_push);
        gnutls_transport_set_pull_function(server, server_pull);
index 5da1124f2dd86da5f10c82939b2fe42049765e67..c08e4d9ae23cfb4902ba64cd52dda9136da70439 100644 (file)
@@ -24,7 +24,9 @@ EXTRA_DIST = client.p12 noclient.p12 unclient.p12 pkcs12_2certs.p12 \
 
 dist_check_SCRIPTS = pkcs12
 
+if !ENABLE_FIPS140
 TESTS = pkcs12
+endif
 
 TESTS_ENVIRONMENT = EXEEXT=$(EXEEXT) \
        LC_ALL="C"                                              \
index 42a01812d39269705971e4e807b7fbfd36e96710..b3252dd160918c7afe59b9b280b30664e6281451 100644 (file)
@@ -81,7 +81,7 @@ void doit(void)
        int ret, indx;
        char outbuf[10240];
        size_t size;
-       int i;
+       unsigned tests, i;
 
        ret = global_init();
        if (ret < 0) {
@@ -128,7 +128,12 @@ void doit(void)
        }
 
        /* Generate and add PKCS#12 cert bags. */
-       for (i = 0; i < 2; i++) {
+#ifndef ENABLE_FIPS140
+       tests = 2; /* include RC2 */
+#else
+       tests = 1;
+#endif
+       for (i = 0; i < tests; i++) {
                ret = gnutls_pkcs12_bag_init(&bag);
                if (ret < 0) {
                        fprintf(stderr, "bag_init: %d", ret);
index bf183fe16406fa4e85f855729a4eeaf760a8fdc1..7b9de3cc64bfa4428275b8465b9942a6f63ee172 100644 (file)
 
 #include "utils.h"
 
+#ifdef ENABLE_FIPS140
+void doit(void)
+{
+       exit(77);
+}
+
+#else
+
 static void
 try_prio(const char *prio, unsigned expected_cs, unsigned expected_ciphers)
 {
@@ -109,3 +117,5 @@ void doit(void)
        try_prio("SECURE128:+SECURE256:+NORMAL", normal, 10);   /* should be the same as NORMAL */
        try_prio("SUITEB192", 1, 1);
 }
+
+#endif
index 11edde15e146f613d6b86c6cadc55f53711a79de..4f52e54a02f0871e2d47b27c2355cecf089b1082 100644 (file)
@@ -43,6 +43,8 @@ static void tls_log_func(int level, const char *str)
 /* This test attempts to transfer various sizes using ARCFOUR-128.
  */
 
+#ifndef ENABLE_FIPS140
+
 #define MAX_BUF 16384
 static char b1[MAX_BUF + 1];
 static char buffer[MAX_BUF + 1];
@@ -156,3 +158,10 @@ void doit(void)
 
        gnutls_global_deinit();
 }
+
+#else
+void doit(void)
+{
+       exit(77);
+}
+#endif
index 5038a8ef47bcd57fa89f8b81788318cfcd650678..9381c3f659c664c4385de8ac445d598890f25964 100644 (file)
@@ -34,6 +34,7 @@ static void tls_log_func(int level, const char *str)
        fprintf(stderr, "<%d>| %s", level, str);
 }
 
+#ifndef ENABLE_FIPS140
 void doit(void)
 {
        gnutls_certificate_credentials_t x509cred;
@@ -113,3 +114,9 @@ void doit(void)
 
        gnutls_global_deinit();
 }
+#else
+void doit(void)
+{
+       exit(77);
+}
+#endif