aboutsummaryrefslogtreecommitdiffstats
path: root/crypto/blkcipher.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 18:25:18 -0500
committerDavid S. Miller <davem@sunset.davemloft.net>2007-02-08 18:25:18 -0500
commit9783e1df7a6bd1e4dc5e2cafcdc29b65a47473d6 (patch)
tree9216a285bfe23aa799ca6efa01a3f4063d798e64 /crypto/blkcipher.c
parent4387ff75f29412a234d394b0276c2b239d3d3844 (diff)
parentdc2e2f33bbf07344995357314fd8887f6564dba7 (diff)
Merge branch 'HEAD' of master.kernel.org:/pub/scm/linux/kernel/git/herbert/crypto-2.6
Conflicts: crypto/Kconfig
Diffstat (limited to 'crypto/blkcipher.c')
-rw-r--r--crypto/blkcipher.c9
1 files changed, 7 insertions, 2 deletions
diff --git a/crypto/blkcipher.c b/crypto/blkcipher.c
index 6e93004f2181..b5befe8c3a96 100644
--- a/crypto/blkcipher.c
+++ b/crypto/blkcipher.c
@@ -16,6 +16,7 @@
16 16
17#include <linux/crypto.h> 17#include <linux/crypto.h>
18#include <linux/errno.h> 18#include <linux/errno.h>
19#include <linux/hardirq.h>
19#include <linux/kernel.h> 20#include <linux/kernel.h>
20#include <linux/module.h> 21#include <linux/module.h>
21#include <linux/scatterlist.h> 22#include <linux/scatterlist.h>
@@ -313,6 +314,9 @@ static int blkcipher_walk_first(struct blkcipher_desc *desc,
313 struct crypto_blkcipher *tfm = desc->tfm; 314 struct crypto_blkcipher *tfm = desc->tfm;
314 unsigned int alignmask = crypto_blkcipher_alignmask(tfm); 315 unsigned int alignmask = crypto_blkcipher_alignmask(tfm);
315 316
317 if (WARN_ON_ONCE(in_irq()))
318 return -EDEADLK;
319
316 walk->nbytes = walk->total; 320 walk->nbytes = walk->total;
317 if (unlikely(!walk->total)) 321 if (unlikely(!walk->total))
318 return 0; 322 return 0;
@@ -345,7 +349,8 @@ static int setkey(struct crypto_tfm *tfm, const u8 *key,
345 return cipher->setkey(tfm, key, keylen); 349 return cipher->setkey(tfm, key, keylen);
346} 350}
347 351
348static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg) 352static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg, u32 type,
353 u32 mask)
349{ 354{
350 struct blkcipher_alg *cipher = &alg->cra_blkcipher; 355 struct blkcipher_alg *cipher = &alg->cra_blkcipher;
351 unsigned int len = alg->cra_ctxsize; 356 unsigned int len = alg->cra_ctxsize;
@@ -358,7 +363,7 @@ static unsigned int crypto_blkcipher_ctxsize(struct crypto_alg *alg)
358 return len; 363 return len;
359} 364}
360 365
361static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm) 366static int crypto_init_blkcipher_ops(struct crypto_tfm *tfm, u32 type, u32 mask)
362{ 367{
363 struct blkcipher_tfm *crt = &tfm->crt_blkcipher; 368 struct blkcipher_tfm *crt = &tfm->crt_blkcipher;
364 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher; 369 struct blkcipher_alg *alg = &tfm->__crt_alg->cra_blkcipher;