git.openpandora.org
/
pandora-kernel.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
crypto: skcipher - Add crypto_skcipher_has_setkey
[pandora-kernel.git]
/
crypto
/
ahash.c
diff --git
a/crypto/ahash.c
b/crypto/ahash.c
index
ac93c99
..
7fd8ecf
100644
(file)
--- a/
crypto/ahash.c
+++ b/
crypto/ahash.c
@@
-369,6
+369,7
@@
static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
struct ahash_alg *alg = crypto_ahash_alg(hash);
hash->setkey = ahash_nosetkey;
struct ahash_alg *alg = crypto_ahash_alg(hash);
hash->setkey = ahash_nosetkey;
+ hash->has_setkey = false;
hash->export = ahash_no_export;
hash->import = ahash_no_import;
hash->export = ahash_no_export;
hash->import = ahash_no_import;
@@
-381,8
+382,10
@@
static int crypto_ahash_init_tfm(struct crypto_tfm *tfm)
hash->finup = alg->finup ?: ahash_def_finup;
hash->digest = alg->digest;
hash->finup = alg->finup ?: ahash_def_finup;
hash->digest = alg->digest;
- if (alg->setkey)
+ if (alg->setkey)
{
hash->setkey = alg->setkey;
hash->setkey = alg->setkey;
+ hash->has_setkey = true;
+ }
if (alg->export)
hash->export = alg->export;
if (alg->import)
if (alg->export)
hash->export = alg->export;
if (alg->import)
@@
-404,7
+407,7
@@
static int crypto_ahash_report(struct sk_buff *skb, struct crypto_alg *alg)
{
struct crypto_report_hash rhash;
{
struct crypto_report_hash rhash;
- s
nprintf(rhash.type, CRYPTO_MAX_ALG_NAME, "%s", "ahash"
);
+ s
trncpy(rhash.type, "ahash", sizeof(rhash.type)
);
rhash.blocksize = alg->cra_blocksize;
rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize;
rhash.blocksize = alg->cra_blocksize;
rhash.digestsize = __crypto_hash_alg_common(alg)->digestsize;
@@
-462,7
+465,8
@@
static int ahash_prepare_alg(struct ahash_alg *alg)
struct crypto_alg *base = &alg->halg.base;
if (alg->halg.digestsize > PAGE_SIZE / 8 ||
struct crypto_alg *base = &alg->halg.base;
if (alg->halg.digestsize > PAGE_SIZE / 8 ||
- alg->halg.statesize > PAGE_SIZE / 8)
+ alg->halg.statesize > PAGE_SIZE / 8 ||
+ alg->halg.statesize == 0)
return -EINVAL;
base->cra_type = &crypto_ahash_type;
return -EINVAL;
base->cra_type = &crypto_ahash_type;