gentleknife / rpms / libgcrypt

Forked from rpms/libgcrypt 4 years ago
Clone
Blob Blame History Raw
diff -up libgcrypt-1.5.3/tests/basic.c.fips-test libgcrypt-1.5.3/tests/basic.c
--- libgcrypt-1.5.3/tests/basic.c.fips-test	2014-09-26 17:36:41.620556071 +0200
+++ libgcrypt-1.5.3/tests/basic.c	2014-09-26 17:36:43.317594382 +0200
@@ -563,6 +563,14 @@ check_ctr_cipher (void)
       if (!tv[i].algo)
         continue;
 
+      if (gcry_cipher_test_algo (tv[i].algo) && in_fips_mode)
+        {
+          if (verbose)
+            fprintf (stderr, "  algorithm %d not available in fips mode\n",
+                     tv[i].algo);
+          continue;
+        }
+
       err = gcry_cipher_open (&hde, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0);
       if (!err)
 	err = gcry_cipher_open (&hdd, tv[i].algo, GCRY_CIPHER_MODE_CTR, 0);