summaryrefslogtreecommitdiff
path: root/crypto/mcryptd.c
diff options
context:
space:
mode:
authorBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-03-07 13:57:24 +0100
committerBartlomiej Zolnierkiewicz <b.zolnierkie@samsung.com>2018-03-07 13:57:24 +0100
commit249b6bae56fc18f4512fe5bc085f71cc235c0735 (patch)
tree89cf28b0e13c85f0a04d216121cbdafdf9668ba0 /crypto/mcryptd.c
parent59d9ddb192bc424cc53e52180478001af4fb99a4 (diff)
parentc7ee969dff58a7f5e447e27fe064e2d1ce81d574 (diff)
downloadlinux-crypto-249b6bae56fc18f4512fe5bc085f71cc235c0735.tar.gz
linux-crypto-249b6bae56fc18f4512fe5bc085f71cc235c0735.zip
Merge tag 'v4.16-rc4' of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux into fbdev-for-next
Linux 4.16-rc4
Diffstat (limited to 'crypto/mcryptd.c')
-rw-r--r--crypto/mcryptd.c11
1 files changed, 5 insertions, 6 deletions
diff --git a/crypto/mcryptd.c b/crypto/mcryptd.c
index eca04d37..fe5129d6 100644
--- a/crypto/mcryptd.c
+++ b/crypto/mcryptd.c
@@ -26,7 +26,6 @@
#include <linux/sched.h>
#include <linux/sched/stat.h>
#include <linux/slab.h>
-#include <linux/hardirq.h>
#define MCRYPTD_MAX_CPU_QLEN 100
#define MCRYPTD_BATCH 9
@@ -517,10 +516,9 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
if (err)
goto out_free_inst;
- type = CRYPTO_ALG_ASYNC;
- if (alg->cra_flags & CRYPTO_ALG_INTERNAL)
- type |= CRYPTO_ALG_INTERNAL;
- inst->alg.halg.base.cra_flags = type;
+ inst->alg.halg.base.cra_flags = CRYPTO_ALG_ASYNC |
+ (alg->cra_flags & (CRYPTO_ALG_INTERNAL |
+ CRYPTO_ALG_OPTIONAL_KEY));
inst->alg.halg.digestsize = halg->digestsize;
inst->alg.halg.statesize = halg->statesize;
@@ -535,7 +533,8 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
inst->alg.finup = mcryptd_hash_finup_enqueue;
inst->alg.export = mcryptd_hash_export;
inst->alg.import = mcryptd_hash_import;
- inst->alg.setkey = mcryptd_hash_setkey;
+ if (crypto_hash_alg_has_setkey(halg))
+ inst->alg.setkey = mcryptd_hash_setkey;
inst->alg.digest = mcryptd_hash_digest_enqueue;
err = ahash_register_instance(tmpl, inst);