Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 204340
b: refs/heads/master
c: 0b767f9
h: refs/heads/master
v: v3
  • Loading branch information
Alexander Shishkin authored and Herbert Xu committed Jun 3, 2010
1 parent 30e50a7 commit 43b81e2
Show file tree
Hide file tree
Showing 4 changed files with 27 additions and 1 deletion.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: bc94e59662c13516d13e117b6edab4bec487d5a0
refs/heads/master: 0b767f96164b2b27488e3daa722ff16e89d49314
8 changes: 8 additions & 0 deletions trunk/crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,14 @@ config CRYPTO_MANAGER2
select CRYPTO_BLKCIPHER2
select CRYPTO_PCOMP2

config CRYPTO_MANAGER_TESTS
bool "Run algolithms' self-tests"
default y
depends on CRYPTO_MANAGER2
help
Run cryptomanager's tests for the new crypto algorithms being
registered.

config CRYPTO_GF128MUL
tristate "GF(2^128) multiplication functions (EXPERIMENTAL)"
depends on EXPERIMENTAL
Expand Down
4 changes: 4 additions & 0 deletions trunk/crypto/algboss.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,7 @@ static int cryptomgr_schedule_probe(struct crypto_larval *larval)
return NOTIFY_OK;
}

#ifdef CONFIG_CRYPTO_MANAGER_TESTS
static int cryptomgr_test(void *data)
{
struct crypto_test_param *param = data;
Expand Down Expand Up @@ -266,15 +267,18 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)
err:
return NOTIFY_OK;
}
#endif /* CONFIG_CRYPTO_MANAGER_TESTS */

static int cryptomgr_notify(struct notifier_block *this, unsigned long msg,
void *data)
{
switch (msg) {
case CRYPTO_MSG_ALG_REQUEST:
return cryptomgr_schedule_probe(data);
#ifdef CONFIG_CRYPTO_MANAGER_TESTS
case CRYPTO_MSG_ALG_REGISTER:
return cryptomgr_schedule_test(data);
#endif
}

return NOTIFY_DONE;
Expand Down
14 changes: 14 additions & 0 deletions trunk/crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -22,6 +22,17 @@
#include <crypto/rng.h>

#include "internal.h"

#ifndef CONFIG_CRYPTO_MANAGER_TESTS

/* a perfect nop */
int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
{
return 0;
}

#else

#include "testmgr.h"

/*
Expand Down Expand Up @@ -2530,4 +2541,7 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
non_fips_alg:
return -EINVAL;
}

#endif /* CONFIG_CRYPTO_MANAGER_TESTS */

EXPORT_SYMBOL_GPL(alg_test);

0 comments on commit 43b81e2

Please sign in to comment.