diff options
author | Linus Torvalds | 2019-04-07 19:51:09 -1000 |
---|---|---|
committer | Linus Torvalds | 2019-04-07 19:51:09 -1000 |
commit | fd008d1a7a204695f0e5e003af16448bb9c34b7b (patch) | |
tree | 610613635fd062da213f165af548c74412907472 /drivers | |
parent | fcf88917dd435c6a4cb2830cb086ee58605a1d85 (diff) | |
parent | b4e9e931e9bb2f5b302ce66640832f5a3e57e8c4 (diff) |
Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6
Pull crypto fix from Herbert Xu:
"This fixes a bug in the implementation of xcbc and cmac in caam"
* 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6:
crypto: caam - fix copy of next buffer for xcbc and cmac
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/crypto/caam/caamhash.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/drivers/crypto/caam/caamhash.c b/drivers/crypto/caam/caamhash.c index b1eadc6652b5..7205d9f4029e 100644 --- a/drivers/crypto/caam/caamhash.c +++ b/drivers/crypto/caam/caamhash.c @@ -865,19 +865,18 @@ static int ahash_update_ctx(struct ahash_request *req) if (ret) goto unmap_ctx; - if (mapped_nents) { + if (mapped_nents) sg_to_sec4_sg_last(req->src, mapped_nents, edesc->sec4_sg + sec4_sg_src_index, 0); - if (*next_buflen) - scatterwalk_map_and_copy(next_buf, req->src, - to_hash - *buflen, - *next_buflen, 0); - } else { + else sg_to_sec4_set_last(edesc->sec4_sg + sec4_sg_src_index - 1); - } + if (*next_buflen) + scatterwalk_map_and_copy(next_buf, req->src, + to_hash - *buflen, + *next_buflen, 0); desc = edesc->hw_desc; edesc->sec4_sg_dma = dma_map_single(jrdev, edesc->sec4_sg, |