Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 132697
b: refs/heads/master
c: 6fe4a28
h: refs/heads/master
i:
  132695: 4e0e424
v: v3
  • Loading branch information
Herbert Xu committed Feb 18, 2009
1 parent 328f80d commit a3f42f6
Show file tree
Hide file tree
Showing 2 changed files with 17 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: 5852ae42424e3ddba2d3bdf594f72189497f17ee
refs/heads/master: 6fe4a28d8855e072036f36ee22f0a8f43f44918f
20 changes: 16 additions & 4 deletions trunk/crypto/algboss.c
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
*
*/

#include <linux/crypto.h>
#include <crypto/internal/aead.h>
#include <linux/ctype.h>
#include <linux/err.h>
#include <linux/init.h>
Expand Down Expand Up @@ -206,8 +206,7 @@ static int cryptomgr_test(void *data)
u32 type = param->type;
int err = 0;

if (!((type ^ CRYPTO_ALG_TYPE_BLKCIPHER) &
CRYPTO_ALG_TYPE_BLKCIPHER_MASK) && !(type & CRYPTO_ALG_GENIV))
if (type & CRYPTO_ALG_TESTED)
goto skiptest;

err = alg_test(param->driver, param->alg, type, CRYPTO_ALG_TESTED);
Expand All @@ -223,6 +222,7 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)
{
struct task_struct *thread;
struct crypto_test_param *param;
u32 type;

if (!try_module_get(THIS_MODULE))
goto err;
Expand All @@ -233,7 +233,19 @@ static int cryptomgr_schedule_test(struct crypto_alg *alg)

memcpy(param->driver, alg->cra_driver_name, sizeof(param->driver));
memcpy(param->alg, alg->cra_name, sizeof(param->alg));
param->type = alg->cra_flags;
type = alg->cra_flags;

/* This piece of crap needs to disappear into per-type test hooks. */
if ((!((type ^ CRYPTO_ALG_TYPE_BLKCIPHER) &
CRYPTO_ALG_TYPE_BLKCIPHER_MASK) && !(type & CRYPTO_ALG_GENIV) &&
((alg->cra_flags & CRYPTO_ALG_TYPE_MASK) ==
CRYPTO_ALG_TYPE_BLKCIPHER ? alg->cra_blkcipher.ivsize :
alg->cra_ablkcipher.ivsize)) ||
(!((type ^ CRYPTO_ALG_TYPE_AEAD) & CRYPTO_ALG_TYPE_MASK) &&
alg->cra_type == &crypto_nivaead_type && alg->cra_aead.ivsize))
type |= CRYPTO_ALG_TESTED;

param->type = type;

thread = kthread_run(cryptomgr_test, param, "cryptomgr_test");
if (IS_ERR(thread))
Expand Down

0 comments on commit a3f42f6

Please sign in to comment.