projects/linux·commit e2664ecb

crypto: ccp - Ignore tag length when decrypting GCM ciphertext

e2664ecb · Gary R Hook <[email protected]> · 2019-07-30 16:05:26 +00:00

AES GCM input buffers for decryption contain AAD+CTEXT+TAG. Only
decrypt the ciphertext, and use the tag for comparison.

Fixes: 36cf515b9bbe2 ("crypto: ccp - Enable support for AES GCM on v5 CCPs")
Cc: <[email protected]>
Signed-off-by: Gary R Hook <[email protected]>
Signed-off-by: Herbert Xu <[email protected]>
Commit
e2664ecbb2f26225ac6646876f2899558ffb2604
Parents
9f00baf7

Changes

1 files changed · +1 −2

FileStatusAddDelContent
drivers/crypto/ccp/ccp-ops.cmodified+1−2View file

drivers/crypto/ccp/ccp-ops.c

View file
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c
index ef723e2..76e1b4d 100644
--- a/drivers/crypto/ccp/ccp-ops.c
+++ b/drivers/crypto/ccp/ccp-ops.c
@@ -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;