summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/amcc/crypto4xx_core.c
diff options
context:
space:
mode:
authorChristian Lamparter <chunkeey@gmail.com>2019-04-22 13:26:00 +0200
committerHerbert Xu <herbert@gondor.apana.org.au>2019-05-03 08:03:29 +0200
commit9848e4c873c1cae019bbef4ab3a500a05ca59fe6 (patch)
tree1ed5c1beebe3a50edd2391bac72a8aab4cabbc16 /drivers/crypto/amcc/crypto4xx_core.c
parentcrypto: crypto4xx - fix cfb and ofb "overran dst buffer" issues (diff)
downloadlinux-9848e4c873c1cae019bbef4ab3a500a05ca59fe6.tar.xz
linux-9848e4c873c1cae019bbef4ab3a500a05ca59fe6.zip
crypto: crypto4xx - use sync skcipher for fallback
This replaces struct crypto_skcipher and the extra request size with struct crypto_sync_skcipher and SYNC_SKCIPHER_REQUEST_ON_STACK(), which uses a fixed stack size. Signed-off-by: Christian Lamparter <chunkeey@gmail.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to 'drivers/crypto/amcc/crypto4xx_core.c')
-rw-r--r--drivers/crypto/amcc/crypto4xx_core.c11
1 files changed, 3 insertions, 8 deletions
diff --git a/drivers/crypto/amcc/crypto4xx_core.c b/drivers/crypto/amcc/crypto4xx_core.c
index 920bd5e720b2..3e7d24ff3fa6 100644
--- a/drivers/crypto/amcc/crypto4xx_core.c
+++ b/drivers/crypto/amcc/crypto4xx_core.c
@@ -965,15 +965,10 @@ static int crypto4xx_sk_init(struct crypto_skcipher *sk)
if (alg->base.cra_flags & CRYPTO_ALG_NEED_FALLBACK) {
ctx->sw_cipher.cipher =
- crypto_alloc_skcipher(alg->base.cra_name, 0,
- CRYPTO_ALG_NEED_FALLBACK |
- CRYPTO_ALG_ASYNC);
+ crypto_alloc_sync_skcipher(alg->base.cra_name, 0,
+ CRYPTO_ALG_NEED_FALLBACK);
if (IS_ERR(ctx->sw_cipher.cipher))
return PTR_ERR(ctx->sw_cipher.cipher);
-
- crypto_skcipher_set_reqsize(sk,
- sizeof(struct skcipher_request) + 32 +
- crypto_skcipher_reqsize(ctx->sw_cipher.cipher));
}
amcc_alg = container_of(alg, struct crypto4xx_alg, alg.u.cipher);
@@ -992,7 +987,7 @@ static void crypto4xx_sk_exit(struct crypto_skcipher *sk)
crypto4xx_common_exit(ctx);
if (ctx->sw_cipher.cipher)
- crypto_free_skcipher(ctx->sw_cipher.cipher);
+ crypto_free_sync_skcipher(ctx->sw_cipher.cipher);
}
static int crypto4xx_aead_init(struct crypto_aead *tfm)