Skip to content

Commit

Permalink
crypto: ccp - Ignore tag length when decrypting GCM ciphertext
Browse files Browse the repository at this point in the history
AES GCM input buffers for decryption contain AAD+CTEXT+TAG. Only
decrypt the ciphertext, and use the tag for comparison.

Fixes: 36cf515 ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Cc: <stable@vger.kernel.org>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
  • Loading branch information
Gary R Hook authored and Herbert Xu committed Aug 2, 2019
1 parent 9f00baf commit e2664ec
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions drivers/crypto/ccp/ccp-ops.c
Original file line number Diff line number Diff line change
Expand Up @@ -782,8 +782,7 @@ static int ccp_run_aes_gcm_cmd(struct ccp_cmd_queue *cmd_q,
while (src.sg_wa.bytes_left) {
ccp_prepare_data(&src, &dst, &op, AES_BLOCK_SIZE, true);
if (!src.sg_wa.bytes_left) {
unsigned int nbytes = aes->src_len
% AES_BLOCK_SIZE;
unsigned int nbytes = ilen % AES_BLOCK_SIZE;

if (nbytes) {
op.eom = 1;
Expand Down

0 comments on commit e2664ec

Please sign in to comment.