summaryrefslogtreecommitdiffstats
path: root/crypto/mcryptd.c
diff options
context:
space:
mode:
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 eca04d3729b3..fe5129d6ff4e 100644
--- a/crypto/mcryptd.c
+++ b/crypto/mcryptd.c
@@ -26,7 +26,6 @@
26#include <linux/sched.h> 26#include <linux/sched.h>
27#include <linux/sched/stat.h> 27#include <linux/sched/stat.h>
28#include <linux/slab.h> 28#include <linux/slab.h>
29#include <linux/hardirq.h>
30 29
31#define MCRYPTD_MAX_CPU_QLEN 100 30#define MCRYPTD_MAX_CPU_QLEN 100
32#define MCRYPTD_BATCH 9 31#define MCRYPTD_BATCH 9
@@ -517,10 +516,9 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
517 if (err) 516 if (err)
518 goto out_free_inst; 517 goto out_free_inst;
519 518
520 type = CRYPTO_ALG_ASYNC; 519 inst->alg.halg.base.cra_flags = CRYPTO_ALG_ASYNC |
521 if (alg->cra_flags & CRYPTO_ALG_INTERNAL) 520 (alg->cra_flags & (CRYPTO_ALG_INTERNAL |
522 type |= CRYPTO_ALG_INTERNAL; 521 CRYPTO_ALG_OPTIONAL_KEY));
523 inst->alg.halg.base.cra_flags = type;
524 522
525 inst->alg.halg.digestsize = halg->digestsize; 523 inst->alg.halg.digestsize = halg->digestsize;
526 inst->alg.halg.statesize = halg->statesize; 524 inst->alg.halg.statesize = halg->statesize;
@@ -535,7 +533,8 @@ static int mcryptd_create_hash(struct crypto_template *tmpl, struct rtattr **tb,
535 inst->alg.finup = mcryptd_hash_finup_enqueue; 533 inst->alg.finup = mcryptd_hash_finup_enqueue;
536 inst->alg.export = mcryptd_hash_export; 534 inst->alg.export = mcryptd_hash_export;
537 inst->alg.import = mcryptd_hash_import; 535 inst->alg.import = mcryptd_hash_import;
538 inst->alg.setkey = mcryptd_hash_setkey; 536 if (crypto_hash_alg_has_setkey(halg))
537 inst->alg.setkey = mcryptd_hash_setkey;
539 inst->alg.digest = mcryptd_hash_digest_enqueue; 538 inst->alg.digest = mcryptd_hash_digest_enqueue;
540 539
541 err = ahash_register_instance(tmpl, inst); 540 err = ahash_register_instance(tmpl, inst);