diff options
author | Gary R Hook <gary.hook@amd.com> | 2019-07-30 16:05:26 +0000 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2019-08-16 10:12:38 +0200 |
commit | 6dbc3b74daeb3475354cd135fcbfe14ae6abfe24 (patch) | |
tree | 794ef39cf4a95fb803409ca92a576a0782e6fcff /drivers/crypto | |
parent | 30692edea30d633212e01f2378ac94d09c52f5d3 (diff) | |
download | linux-stable-6dbc3b74daeb3475354cd135fcbfe14ae6abfe24.tar.gz linux-stable-6dbc3b74daeb3475354cd135fcbfe14ae6abfe24.tar.bz2 linux-stable-6dbc3b74daeb3475354cd135fcbfe14ae6abfe24.zip |
crypto: ccp - Ignore tag length when decrypting GCM ciphertext
commit e2664ecbb2f26225ac6646876f2899558ffb2604 upstream.
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: <stable@vger.kernel.org>
Signed-off-by: Gary R Hook <gary.hook@amd.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto')
-rw-r--r-- | drivers/crypto/ccp/ccp-ops.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/crypto/ccp/ccp-ops.c b/drivers/crypto/ccp/ccp-ops.c index a01db9a8ca14..1e2e42106dee 100644 --- a/drivers/crypto/ccp/ccp-ops.c +++ b/drivers/crypto/ccp/ccp-ops.c @@ -785,8 +785,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; |