tracing: extend sched_pi_setprio
[deliverable/linux.git] / crypto / testmgr.c
index 5c9d5a5e7b65182ed1f78b5c0332c5c9b2a328c1..0b01c3d062e2f97103777f7cc941f895a1b41266 100644 (file)
@@ -665,7 +665,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
                memcpy(key, template[i].key, template[i].klen);
 
                ret = crypto_aead_setkey(tfm, key, template[i].klen);
-               if (!ret == template[i].fail) {
+               if (template[i].fail == !ret) {
                        pr_err("alg: aead%s: setkey failed on test %d for %s: flags=%x\n",
                               d, j, algo, crypto_aead_get_flags(tfm));
                        goto out;
@@ -770,7 +770,7 @@ static int __test_aead(struct crypto_aead *tfm, int enc,
                memcpy(key, template[i].key, template[i].klen);
 
                ret = crypto_aead_setkey(tfm, key, template[i].klen);
-               if (!ret == template[i].fail) {
+               if (template[i].fail == !ret) {
                        pr_err("alg: aead%s: setkey failed on chunk test %d for %s: flags=%x\n",
                               d, j, algo, crypto_aead_get_flags(tfm));
                        goto out;
@@ -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;
@@ -1023,7 +1026,7 @@ static int test_cipher(struct crypto_cipher *tfm, int enc,
 
                ret = crypto_cipher_setkey(tfm, template[i].key,
                                           template[i].klen);
-               if (!ret == template[i].fail) {
+               if (template[i].fail == !ret) {
                        printk(KERN_ERR "alg: cipher: setkey failed "
                               "on test %d for %s: flags=%x\n", j,
                               algo, crypto_cipher_get_flags(tfm));
@@ -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
@@ -1133,7 +1139,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
 
                ret = crypto_skcipher_setkey(tfm, template[i].key,
                                             template[i].klen);
-               if (!ret == template[i].fail) {
+               if (template[i].fail == !ret) {
                        pr_err("alg: skcipher%s: setkey failed on test %d for %s: flags=%x\n",
                               d, j, algo, crypto_skcipher_get_flags(tfm));
                        goto out;
@@ -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
@@ -1211,7 +1220,7 @@ static int __test_skcipher(struct crypto_skcipher *tfm, int enc,
 
                ret = crypto_skcipher_setkey(tfm, template[i].key,
                                             template[i].klen);
-               if (!ret == template[i].fail) {
+               if (template[i].fail == !ret) {
                        pr_err("alg: skcipher%s: setkey failed on chunk test %d for %s: flags=%x\n",
                               d, j, algo, crypto_skcipher_get_flags(tfm));
                        goto out;
This page took 0.025888 seconds and 5 git commands to generate.