Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 157940
b: refs/heads/master
c: a68f661
h: refs/heads/master
v: v3
  • Loading branch information
Herbert Xu committed Jul 2, 2009
1 parent f57f9f2 commit cc92d59
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 5 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 0b67fb65d1b2ba1396de69112b8b9bc95d8d5feb
refs/heads/master: a68f6610d4f1ebe61818f5926fa8fa9e75d06a95
17 changes: 13 additions & 4 deletions trunk/crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -2344,6 +2344,7 @@ static int alg_find_test(const char *alg)
int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
{
int i;
int j;
int rc;

if ((type & CRYPTO_ALG_TYPE_MASK) == CRYPTO_ALG_TYPE_CIPHER) {
Expand All @@ -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);

test_done:
if (fips_enabled && rc)
panic("%s: %s alg self test failed in fips mode!\n", driver, alg);
Expand Down

0 comments on commit cc92d59

Please sign in to comment.