summaryrefslogtreecommitdiff
path: root/crypto/skcipher.c
diff options
context:
space:
mode:
authorJuergen Gross <jgross@suse.com>2018-01-29 15:54:46 +0100
committerJuergen Gross <jgross@suse.com>2018-01-29 15:54:46 +0100
commitfe8cbbbc0e68dad845f72ad75c8099b88f7ff049 (patch)
tree2bf17da93b86508fe2f66e87f39897a1d4b403dc /crypto/skcipher.c
parent40248a5f572a9ee5602fb61b33ddcc7de3b4cf5b (diff)
parent21864b027d847a6d91903a5ba219770403ba8aad (diff)
downloadlinux-crypto-fe8cbbbc0e68dad845f72ad75c8099b88f7ff049.tar.gz
linux-crypto-fe8cbbbc0e68dad845f72ad75c8099b88f7ff049.zip
Merge branch 'master' of ssh://gitolite.kernel.org/pub/scm/linux/kernel/git/torvalds/linux
Diffstat (limited to 'crypto/skcipher.c')
-rw-r--r--crypto/skcipher.c11
1 files changed, 6 insertions, 5 deletions
diff --git a/crypto/skcipher.c b/crypto/skcipher.c
index d5692e35..11af5fd6 100644
--- a/crypto/skcipher.c
+++ b/crypto/skcipher.c
@@ -449,6 +449,8 @@ static int skcipher_walk_skcipher(struct skcipher_walk *walk,
walk->total = req->cryptlen;
walk->nbytes = 0;
+ walk->iv = req->iv;
+ walk->oiv = req->iv;
if (unlikely(!walk->total))
return 0;
@@ -456,9 +458,6 @@ static int skcipher_walk_skcipher(struct skcipher_walk *walk,
scatterwalk_start(&walk->in, req->src);
scatterwalk_start(&walk->out, req->dst);
- walk->iv = req->iv;
- walk->oiv = req->iv;
-
walk->flags &= ~SKCIPHER_WALK_SLEEP;
walk->flags |= req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP ?
SKCIPHER_WALK_SLEEP : 0;
@@ -510,6 +509,8 @@ static int skcipher_walk_aead_common(struct skcipher_walk *walk,
int err;
walk->nbytes = 0;
+ walk->iv = req->iv;
+ walk->oiv = req->iv;
if (unlikely(!walk->total))
return 0;
@@ -522,8 +523,8 @@ static int skcipher_walk_aead_common(struct skcipher_walk *walk,
scatterwalk_copychunks(NULL, &walk->in, req->assoclen, 2);
scatterwalk_copychunks(NULL, &walk->out, req->assoclen, 2);
- walk->iv = req->iv;
- walk->oiv = req->iv;
+ scatterwalk_done(&walk->in, 0, walk->total);
+ scatterwalk_done(&walk->out, 0, walk->total);
if (req->base.flags & CRYPTO_TFM_REQ_MAY_SLEEP)
walk->flags |= SKCIPHER_WALK_SLEEP;