]> git.proxmox.com Git - mirror_ubuntu-bionic-kernel.git/blobdiff - crypto/testmgr.c
crypto: FIPS - allow tests to be disabled in FIPS mode
[mirror_ubuntu-bionic-kernel.git] / crypto / testmgr.c
index c2a8bd38ef1f17c6641dbb5631c17e730cdc3c10..0b01c3d062e2f97103777f7cc941f895a1b41266 100644 (file)
@@ -1008,6 +1008,9 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
                if (template[i].np)
                        continue;
 
+               if (fips_enabled && template[i].fips_skip)
+                       continue;
+
                j++;
 
                ret = -EINVAL;
@@ -1112,6 +1115,9 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
                if (template[i].np && !template[i].also_non_np)
                        continue;
 
+               if (fips_enabled && template[i].fips_skip)
+                       continue;
+
                if (template[i].iv)
                        memcpy(iv, template[i].iv, ivsize);
                else
@@ -1198,6 +1204,9 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
                if (!template[i].np)
                        continue;
 
+               if (fips_enabled && template[i].fips_skip)
+                       continue;
+
                if (template[i].iv)
                        memcpy(iv, template[i].iv, ivsize);
                else