Skip to content

Commit

Permalink
crypto: arm64/aes-ce-ccm - Fix AEAD decryption length
Browse files Browse the repository at this point in the history
This patch fixes the ARM64 CE CCM implementation decryption by
using skcipher_walk_aead_decrypt instead of skcipher_walk_aead,
which ensures the correct length is used when doing the walk.

Fixes: cf2c0fe ("crypto: aes-ce-ccm - Use skcipher walk interface")
Reported-by: Ard Biesheuvel <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
  • Loading branch information
herbertx committed Dec 1, 2016
1 parent ff330f7 commit 0be8a27
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arch/arm64/crypto/aes-ce-ccm-glue.c
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,7 @@ static int ccm_encrypt(struct aead_request *req)
/* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE);

err = skcipher_walk_aead(&walk, req, true);
err = skcipher_walk_aead_encrypt(&walk, req, true);

while (walk.nbytes) {
u32 tail = walk.nbytes % AES_BLOCK_SIZE;
Expand Down Expand Up @@ -219,7 +219,7 @@ static int ccm_decrypt(struct aead_request *req)
/* preserve the original iv for the final round */
memcpy(buf, req->iv, AES_BLOCK_SIZE);

err = skcipher_walk_aead(&walk, req, true);
err = skcipher_walk_aead_decrypt(&walk, req, true);

while (walk.nbytes) {
u32 tail = walk.nbytes % AES_BLOCK_SIZE;
Expand Down

0 comments on commit 0be8a27

Please sign in to comment.