Re: [PATCH] crypto: Update stdrng test name so that the testmgr finds it properly

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



* Herbert Xu | 2009-07-02 16:32:59 [+0800]:

>--- a/crypto/testmgr.c
>+++ b/crypto/testmgr.c
>@@ -2365,14 +2366,22 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
> 	}
> 
> 	i = alg_find_test(alg);
>-	if (i < 0)
>+	j = alg_find_test(driver);
>+	if (i < 0 && j < 0)
> 		goto notest;
> 
>-	if (fips_enabled && !alg_test_descs[i].fips_allowed)
>+	if (fips_enabled && ((i >= 0 && !alg_test_descs[i].fips_allowed) ||
>+			     (j >= 0 && !alg_test_descs[j].fips_allowed)))
> 		goto non_fips_alg;
> 
>-	rc = alg_test_descs[i].test(alg_test_descs + i, driver,
>-				      type, mask);
>+	rc = 0;
>+	if (i >= 0)
>+		rc |= alg_test_descs[i].test(alg_test_descs + i, driver,
>+					     type, mask);
>+	if (j >= 0)
>+		rc |= alg_test_descs[j].test(alg_test_descs + j, driver,
>+					     type, mask);

Do you execute test2 if test1 failed on purpose?
If not what about:

	if (!rc && j >= 0)
		rc = alg_test_descs[j].test(alg_test_descs + j, driver,
					     type, mask);

so there is return code mixup.

Sebastian
--
To unsubscribe from this list: send the line "unsubscribe linux-crypto" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel]     [Gnu Classpath]     [Gnu Crypto]     [DM Crypt]     [Netfilter]     [Bugtraq]

  Powered by Linux