summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2019-09-10 11:42:05 +1000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2020-01-17 19:48:46 +0100
commitd9dea35fc6e45df4871717cfdff43ba196f7ce95 (patch)
treef7f0e52e8e09eddda52b25cfeb797bf014ad3a36
parent9d5ef3a2f3939b74ff90cc10b1a3fe33193f5d0f (diff)
downloadlinux-crypto-d9dea35fc6e45df4871717cfdff43ba196f7ce95.tar.gz
linux-crypto-d9dea35fc6e45df4871717cfdff43ba196f7ce95.zip
crypto: algif_skcipher - Use chunksize instead of blocksize
commit 69e716c27aed0a841dc987fc980e6e9576887d74 upstream. When algif_skcipher does a partial operation it always process data that is a multiple of blocksize. However, for algorithms such as CTR this is wrong because even though it can process any number of bytes overall, the partial block must come at the very end and not in the middle. This is exactly what chunksize is meant to describe so this patch changes blocksize to chunksize. Fixes: fcbb8a3beda3 ("crypto: algif_skcipher - User-space...") Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Acked-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--crypto/algif_skcipher.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/crypto/algif_skcipher.c b/crypto/algif_skcipher.c
index c1601edd..e2c8ab40 100644
--- a/crypto/algif_skcipher.c
+++ b/crypto/algif_skcipher.c
@@ -56,7 +56,7 @@ static int _skcipher_recvmsg(struct socket *sock, struct msghdr *msg,
struct alg_sock *pask = alg_sk(psk);
struct af_alg_ctx *ctx = ask->private;
struct crypto_skcipher *tfm = pask->private;
- unsigned int bs = crypto_skcipher_blocksize(tfm);
+ unsigned int bs = crypto_skcipher_chunksize(tfm);
struct af_alg_async_req *areq;
int err = 0;
size_t len = 0;