Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210301
b: refs/heads/master
c: 326a634
h: refs/heads/master
i:
  210299: 9805b22
v: v3
  • Loading branch information
Herbert Xu committed Aug 6, 2010
1 parent 946227d commit 84e083a
Show file tree
Hide file tree
Showing 4 changed files with 12 additions and 13 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: 23a75eee070f1370bee803a34f285cf81eb5f331
refs/heads/master: 326a6346ffb5b19eb593530d9d3096d409e46f62
11 changes: 5 additions & 6 deletions trunk/crypto/Kconfig
Original file line number Diff line number Diff line change
Expand Up @@ -101,13 +101,12 @@ config CRYPTO_MANAGER2
select CRYPTO_BLKCIPHER2
select CRYPTO_PCOMP2

config CRYPTO_MANAGER_TESTS
bool "Run algolithms' self-tests"
default y
depends on CRYPTO_MANAGER2
config CRYPTO_MANAGER_DISABLE_TESTS
bool "Disable run-time self tests"
depends on CRYPTO_MANAGER2 && EMBEDDED
help
Run cryptomanager's tests for the new crypto algorithms being
registered.
Disable run-time self tests that normally take place at
algorithm registration.

config CRYPTO_GF128MUL
tristate "GF(2^128) multiplication functions (EXPERIMENTAL)"
Expand Down
8 changes: 4 additions & 4 deletions trunk/crypto/algboss.c
Original file line number Diff line number Diff line change
Expand Up @@ -206,13 +206,16 @@ 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;
u32 type = param->type;
int err = 0;

#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS
goto skiptest;
#endif

if (type & CRYPTO_ALG_TESTED)
goto skiptest;

Expand Down Expand Up @@ -267,18 +270,15 @@ 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
4 changes: 2 additions & 2 deletions trunk/crypto/testmgr.c
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@

#include "internal.h"

#ifndef CONFIG_CRYPTO_MANAGER_TESTS
#ifdef CONFIG_CRYPTO_MANAGER_DISABLE_TESTS

/* a perfect nop */
int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
Expand Down Expand Up @@ -2542,6 +2542,6 @@ int alg_test(const char *driver, const char *alg, u32 type, u32 mask)
return -EINVAL;
}

#endif /* CONFIG_CRYPTO_MANAGER_TESTS */
#endif /* CONFIG_CRYPTO_MANAGER_DISABLE_TESTS */

EXPORT_SYMBOL_GPL(alg_test);

0 comments on commit 84e083a

Please sign in to comment.