diff options
Diffstat (limited to 'crypto')
-rw-r--r-- | crypto/Kconfig | 4 | ||||
-rw-r--r-- | crypto/ahash.c | 1 | ||||
-rw-r--r-- | crypto/algapi.c | 1 | ||||
-rw-r--r-- | crypto/algboss.c | 1 | ||||
-rw-r--r-- | crypto/async_tx/async_pq.c | 1 | ||||
-rw-r--r-- | crypto/async_tx/raid6test.c | 1 | ||||
-rw-r--r-- | crypto/authenc.c | 43 | ||||
-rw-r--r-- | crypto/hmac.c | 1 | ||||
-rw-r--r-- | crypto/md5.c | 1 | ||||
-rw-r--r-- | crypto/rng.c | 1 | ||||
-rw-r--r-- | crypto/seqiv.c | 1 | ||||
-rw-r--r-- | crypto/tcrypt.c | 2 | ||||
-rw-r--r-- | crypto/xor.c | 1 |
13 files changed, 37 insertions, 22 deletions
diff --git a/crypto/Kconfig b/crypto/Kconfig index 6a2e295ee227..403857ad06d4 100644 --- a/crypto/Kconfig +++ b/crypto/Kconfig | |||
@@ -826,8 +826,8 @@ config CRYPTO_ANSI_CPRNG | |||
826 | help | 826 | help |
827 | This option enables the generic pseudo random number generator | 827 | This option enables the generic pseudo random number generator |
828 | for cryptographic modules. Uses the Algorithm specified in | 828 | for cryptographic modules. Uses the Algorithm specified in |
829 | ANSI X9.31 A.2.4. Not this option must be enabled if CRYPTO_FIPS | 829 | ANSI X9.31 A.2.4. Note that this option must be enabled if |
830 | is selected | 830 | CRYPTO_FIPS is selected |
831 | 831 | ||
832 | source "drivers/crypto/Kconfig" | 832 | source "drivers/crypto/Kconfig" |
833 | 833 | ||
diff --git a/crypto/ahash.c b/crypto/ahash.c index 33a4ff45f842..b8c59b889c6e 100644 --- a/crypto/ahash.c +++ b/crypto/ahash.c | |||
@@ -78,7 +78,6 @@ int crypto_hash_walk_done(struct crypto_hash_walk *walk, int err) | |||
78 | walk->data -= walk->offset; | 78 | walk->data -= walk->offset; |
79 | 79 | ||
80 | if (nbytes && walk->offset & alignmask && !err) { | 80 | if (nbytes && walk->offset & alignmask && !err) { |
81 | walk->offset += alignmask - 1; | ||
82 | walk->offset = ALIGN(walk->offset, alignmask + 1); | 81 | walk->offset = ALIGN(walk->offset, alignmask + 1); |
83 | walk->data += walk->offset; | 82 | walk->data += walk->offset; |
84 | 83 | ||
diff --git a/crypto/algapi.c b/crypto/algapi.c index d49d7091cecf..c3cf1a69a47a 100644 --- a/crypto/algapi.c +++ b/crypto/algapi.c | |||
@@ -17,6 +17,7 @@ | |||
17 | #include <linux/list.h> | 17 | #include <linux/list.h> |
18 | #include <linux/module.h> | 18 | #include <linux/module.h> |
19 | #include <linux/rtnetlink.h> | 19 | #include <linux/rtnetlink.h> |
20 | #include <linux/slab.h> | ||
20 | #include <linux/string.h> | 21 | #include <linux/string.h> |
21 | 22 | ||
22 | #include "internal.h" | 23 | #include "internal.h" |
diff --git a/crypto/algboss.c b/crypto/algboss.c index 412241ce4cfa..c3c196b5823a 100644 --- a/crypto/algboss.c +++ b/crypto/algboss.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/notifier.h> | 19 | #include <linux/notifier.h> |
20 | #include <linux/rtnetlink.h> | 20 | #include <linux/rtnetlink.h> |
21 | #include <linux/sched.h> | 21 | #include <linux/sched.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/string.h> | 23 | #include <linux/string.h> |
23 | 24 | ||
24 | #include "internal.h" | 25 | #include "internal.h" |
diff --git a/crypto/async_tx/async_pq.c b/crypto/async_tx/async_pq.c index ec87f53d5059..fdd8257d35d9 100644 --- a/crypto/async_tx/async_pq.c +++ b/crypto/async_tx/async_pq.c | |||
@@ -24,6 +24,7 @@ | |||
24 | #include <linux/dma-mapping.h> | 24 | #include <linux/dma-mapping.h> |
25 | #include <linux/raid/pq.h> | 25 | #include <linux/raid/pq.h> |
26 | #include <linux/async_tx.h> | 26 | #include <linux/async_tx.h> |
27 | #include <linux/gfp.h> | ||
27 | 28 | ||
28 | /** | 29 | /** |
29 | * pq_scribble_page - space to hold throwaway P or Q buffer for | 30 | * pq_scribble_page - space to hold throwaway P or Q buffer for |
diff --git a/crypto/async_tx/raid6test.c b/crypto/async_tx/raid6test.c index f84f6b4301d9..c1321935ebcc 100644 --- a/crypto/async_tx/raid6test.c +++ b/crypto/async_tx/raid6test.c | |||
@@ -20,6 +20,7 @@ | |||
20 | * | 20 | * |
21 | */ | 21 | */ |
22 | #include <linux/async_tx.h> | 22 | #include <linux/async_tx.h> |
23 | #include <linux/gfp.h> | ||
23 | #include <linux/random.h> | 24 | #include <linux/random.h> |
24 | 25 | ||
25 | #undef pr | 26 | #undef pr |
diff --git a/crypto/authenc.c b/crypto/authenc.c index 18870906ea06..05eb32e0d949 100644 --- a/crypto/authenc.c +++ b/crypto/authenc.c | |||
@@ -46,6 +46,12 @@ struct authenc_request_ctx { | |||
46 | char tail[]; | 46 | char tail[]; |
47 | }; | 47 | }; |
48 | 48 | ||
49 | static void authenc_request_complete(struct aead_request *req, int err) | ||
50 | { | ||
51 | if (err != -EINPROGRESS) | ||
52 | aead_request_complete(req, err); | ||
53 | } | ||
54 | |||
49 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, | 55 | static int crypto_authenc_setkey(struct crypto_aead *authenc, const u8 *key, |
50 | unsigned int keylen) | 56 | unsigned int keylen) |
51 | { | 57 | { |
@@ -142,7 +148,7 @@ static void authenc_geniv_ahash_update_done(struct crypto_async_request *areq, | |||
142 | crypto_aead_authsize(authenc), 1); | 148 | crypto_aead_authsize(authenc), 1); |
143 | 149 | ||
144 | out: | 150 | out: |
145 | aead_request_complete(req, err); | 151 | authenc_request_complete(req, err); |
146 | } | 152 | } |
147 | 153 | ||
148 | static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) | 154 | static void authenc_geniv_ahash_done(struct crypto_async_request *areq, int err) |
@@ -208,7 +214,7 @@ static void authenc_verify_ahash_update_done(struct crypto_async_request *areq, | |||
208 | err = crypto_ablkcipher_decrypt(abreq); | 214 | err = crypto_ablkcipher_decrypt(abreq); |
209 | 215 | ||
210 | out: | 216 | out: |
211 | aead_request_complete(req, err); | 217 | authenc_request_complete(req, err); |
212 | } | 218 | } |
213 | 219 | ||
214 | static void authenc_verify_ahash_done(struct crypto_async_request *areq, | 220 | static void authenc_verify_ahash_done(struct crypto_async_request *areq, |
@@ -245,7 +251,7 @@ static void authenc_verify_ahash_done(struct crypto_async_request *areq, | |||
245 | err = crypto_ablkcipher_decrypt(abreq); | 251 | err = crypto_ablkcipher_decrypt(abreq); |
246 | 252 | ||
247 | out: | 253 | out: |
248 | aead_request_complete(req, err); | 254 | authenc_request_complete(req, err); |
249 | } | 255 | } |
250 | 256 | ||
251 | static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags) | 257 | static u8 *crypto_authenc_ahash_fb(struct aead_request *req, unsigned int flags) |
@@ -379,18 +385,20 @@ static void crypto_authenc_encrypt_done(struct crypto_async_request *req, | |||
379 | err = crypto_authenc_genicv(areq, iv, 0); | 385 | err = crypto_authenc_genicv(areq, iv, 0); |
380 | } | 386 | } |
381 | 387 | ||
382 | aead_request_complete(areq, err); | 388 | authenc_request_complete(areq, err); |
383 | } | 389 | } |
384 | 390 | ||
385 | static int crypto_authenc_encrypt(struct aead_request *req) | 391 | static int crypto_authenc_encrypt(struct aead_request *req) |
386 | { | 392 | { |
387 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); | 393 | struct crypto_aead *authenc = crypto_aead_reqtfm(req); |
388 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); | 394 | struct crypto_authenc_ctx *ctx = crypto_aead_ctx(authenc); |
389 | struct ablkcipher_request *abreq = aead_request_ctx(req); | 395 | struct authenc_request_ctx *areq_ctx = aead_request_ctx(req); |
390 | struct crypto_ablkcipher *enc = ctx->enc; | 396 | struct crypto_ablkcipher *enc = ctx->enc; |
391 | struct scatterlist *dst = req->dst; | 397 | struct scatterlist *dst = req->dst; |
392 | unsigned int cryptlen = req->cryptlen; | 398 | unsigned int cryptlen = req->cryptlen; |
393 | u8 *iv = (u8 *)(abreq + 1) + crypto_ablkcipher_reqsize(enc); | 399 | struct ablkcipher_request *abreq = (void *)(areq_ctx->tail |
400 | + ctx->reqoff); | ||
401 | u8 *iv = (u8 *)abreq - crypto_ablkcipher_ivsize(enc); | ||
394 | int err; | 402 | int err; |
395 | 403 | ||
396 | ablkcipher_request_set_tfm(abreq, enc); | 404 | ablkcipher_request_set_tfm(abreq, enc); |
@@ -418,7 +426,7 @@ static void crypto_authenc_givencrypt_done(struct crypto_async_request *req, | |||
418 | err = crypto_authenc_genicv(areq, greq->giv, 0); | 426 | err = crypto_authenc_genicv(areq, greq->giv, 0); |
419 | } | 427 | } |
420 | 428 | ||
421 | aead_request_complete(areq, err); | 429 | authenc_request_complete(areq, err); |
422 | } | 430 | } |
423 | 431 | ||
424 | static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req) | 432 | static int crypto_authenc_givencrypt(struct aead_givcrypt_request *req) |
@@ -454,7 +462,7 @@ static int crypto_authenc_verify(struct aead_request *req, | |||
454 | unsigned int authsize; | 462 | unsigned int authsize; |
455 | 463 | ||
456 | areq_ctx->complete = authenc_verify_ahash_done; | 464 | areq_ctx->complete = authenc_verify_ahash_done; |
457 | areq_ctx->complete = authenc_verify_ahash_update_done; | 465 | areq_ctx->update_complete = authenc_verify_ahash_update_done; |
458 | 466 | ||
459 | ohash = authenc_ahash_fn(req, CRYPTO_TFM_REQ_MAY_SLEEP); | 467 | ohash = authenc_ahash_fn(req, CRYPTO_TFM_REQ_MAY_SLEEP); |
460 | if (IS_ERR(ohash)) | 468 | if (IS_ERR(ohash)) |
@@ -546,10 +554,6 @@ static int crypto_authenc_init_tfm(struct crypto_tfm *tfm) | |||
546 | if (IS_ERR(auth)) | 554 | if (IS_ERR(auth)) |
547 | return PTR_ERR(auth); | 555 | return PTR_ERR(auth); |
548 | 556 | ||
549 | ctx->reqoff = ALIGN(2 * crypto_ahash_digestsize(auth) + | ||
550 | crypto_ahash_alignmask(auth), | ||
551 | crypto_ahash_alignmask(auth) + 1); | ||
552 | |||
553 | enc = crypto_spawn_skcipher(&ictx->enc); | 557 | enc = crypto_spawn_skcipher(&ictx->enc); |
554 | err = PTR_ERR(enc); | 558 | err = PTR_ERR(enc); |
555 | if (IS_ERR(enc)) | 559 | if (IS_ERR(enc)) |
@@ -558,13 +562,18 @@ static int crypto_authenc_init_tfm(struct crypto_tfm *tfm) | |||
558 | ctx->auth = auth; | 562 | ctx->auth = auth; |
559 | ctx->enc = enc; | 563 | ctx->enc = enc; |
560 | 564 | ||
561 | tfm->crt_aead.reqsize = max_t(unsigned int, | 565 | ctx->reqoff = ALIGN(2 * crypto_ahash_digestsize(auth) + |
562 | crypto_ahash_reqsize(auth) + ctx->reqoff + | 566 | crypto_ahash_alignmask(auth), |
563 | sizeof(struct authenc_request_ctx) + | 567 | crypto_ahash_alignmask(auth) + 1) + |
568 | crypto_ablkcipher_ivsize(enc); | ||
569 | |||
570 | tfm->crt_aead.reqsize = sizeof(struct authenc_request_ctx) + | ||
571 | ctx->reqoff + | ||
572 | max_t(unsigned int, | ||
573 | crypto_ahash_reqsize(auth) + | ||
564 | sizeof(struct ahash_request), | 574 | sizeof(struct ahash_request), |
565 | sizeof(struct skcipher_givcrypt_request) + | 575 | sizeof(struct skcipher_givcrypt_request) + |
566 | crypto_ablkcipher_reqsize(enc) + | 576 | crypto_ablkcipher_reqsize(enc)); |
567 | crypto_ablkcipher_ivsize(enc)); | ||
568 | 577 | ||
569 | return 0; | 578 | return 0; |
570 | 579 | ||
diff --git a/crypto/hmac.c b/crypto/hmac.c index 15c2eb534541..8d9544cf8169 100644 --- a/crypto/hmac.c +++ b/crypto/hmac.c | |||
@@ -23,7 +23,6 @@ | |||
23 | #include <linux/kernel.h> | 23 | #include <linux/kernel.h> |
24 | #include <linux/module.h> | 24 | #include <linux/module.h> |
25 | #include <linux/scatterlist.h> | 25 | #include <linux/scatterlist.h> |
26 | #include <linux/slab.h> | ||
27 | #include <linux/string.h> | 26 | #include <linux/string.h> |
28 | 27 | ||
29 | struct hmac_ctx { | 28 | struct hmac_ctx { |
diff --git a/crypto/md5.c b/crypto/md5.c index 9fda213a592e..30efc7dad891 100644 --- a/crypto/md5.c +++ b/crypto/md5.c | |||
@@ -234,6 +234,7 @@ static struct shash_alg alg = { | |||
234 | .export = md5_export, | 234 | .export = md5_export, |
235 | .import = md5_import, | 235 | .import = md5_import, |
236 | .descsize = sizeof(struct md5_state), | 236 | .descsize = sizeof(struct md5_state), |
237 | .statesize = sizeof(struct md5_state), | ||
237 | .base = { | 238 | .base = { |
238 | .cra_name = "md5", | 239 | .cra_name = "md5", |
239 | .cra_flags = CRYPTO_ALG_TYPE_SHASH, | 240 | .cra_flags = CRYPTO_ALG_TYPE_SHASH, |
diff --git a/crypto/rng.c b/crypto/rng.c index ba05e7380e76..f93cb5311182 100644 --- a/crypto/rng.c +++ b/crypto/rng.c | |||
@@ -19,6 +19,7 @@ | |||
19 | #include <linux/mutex.h> | 19 | #include <linux/mutex.h> |
20 | #include <linux/random.h> | 20 | #include <linux/random.h> |
21 | #include <linux/seq_file.h> | 21 | #include <linux/seq_file.h> |
22 | #include <linux/slab.h> | ||
22 | #include <linux/string.h> | 23 | #include <linux/string.h> |
23 | 24 | ||
24 | static DEFINE_MUTEX(crypto_default_rng_lock); | 25 | static DEFINE_MUTEX(crypto_default_rng_lock); |
diff --git a/crypto/seqiv.c b/crypto/seqiv.c index 5a013a8bf87a..4c4491229417 100644 --- a/crypto/seqiv.c +++ b/crypto/seqiv.c | |||
@@ -20,6 +20,7 @@ | |||
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/kernel.h> | 21 | #include <linux/kernel.h> |
22 | #include <linux/module.h> | 22 | #include <linux/module.h> |
23 | #include <linux/slab.h> | ||
23 | #include <linux/spinlock.h> | 24 | #include <linux/spinlock.h> |
24 | #include <linux/string.h> | 25 | #include <linux/string.h> |
25 | 26 | ||
diff --git a/crypto/tcrypt.c b/crypto/tcrypt.c index 0b7a8435255b..ea610ad45aa1 100644 --- a/crypto/tcrypt.c +++ b/crypto/tcrypt.c | |||
@@ -18,8 +18,8 @@ | |||
18 | #include <crypto/hash.h> | 18 | #include <crypto/hash.h> |
19 | #include <linux/err.h> | 19 | #include <linux/err.h> |
20 | #include <linux/init.h> | 20 | #include <linux/init.h> |
21 | #include <linux/gfp.h> | ||
21 | #include <linux/module.h> | 22 | #include <linux/module.h> |
22 | #include <linux/slab.h> | ||
23 | #include <linux/scatterlist.h> | 23 | #include <linux/scatterlist.h> |
24 | #include <linux/string.h> | 24 | #include <linux/string.h> |
25 | #include <linux/moduleparam.h> | 25 | #include <linux/moduleparam.h> |
diff --git a/crypto/xor.c b/crypto/xor.c index fc5b836f3430..b75182d8ab14 100644 --- a/crypto/xor.c +++ b/crypto/xor.c | |||
@@ -18,6 +18,7 @@ | |||
18 | 18 | ||
19 | #define BH_TRACE 0 | 19 | #define BH_TRACE 0 |
20 | #include <linux/module.h> | 20 | #include <linux/module.h> |
21 | #include <linux/gfp.h> | ||
21 | #include <linux/raid/xor.h> | 22 | #include <linux/raid/xor.h> |
22 | #include <linux/jiffies.h> | 23 | #include <linux/jiffies.h> |
23 | #include <asm/xor.h> | 24 | #include <asm/xor.h> |