summaryrefslogtreecommitdiffstats
path: root/drivers/crypto/ccp/ccp-crypto-aes-galois.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-12 07:33:23 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-08-12 07:33:23 +0200
commit77e38c19f373c077712e60cd190ca9cba13b7177 (patch)
treec7a743735cffdcaee26ca559888196d229c4ec1e /drivers/crypto/ccp/ccp-crypto-aes-galois.c
parentcec2caedd979e8778b61ca7dd15fa7ec8fcf7162 (diff)
parentd45331b00ddb179e291766617259261c112db872 (diff)
downloadtalos-op-linux-77e38c19f373c077712e60cd190ca9cba13b7177.tar.gz
talos-op-linux-77e38c19f373c077712e60cd190ca9cba13b7177.zip
Merge 5.3-rc4 into char-misc-next
We need the char-misc fixes in here as well. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/crypto/ccp/ccp-crypto-aes-galois.c')
-rw-r--r--drivers/crypto/ccp/ccp-crypto-aes-galois.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/drivers/crypto/ccp/ccp-crypto-aes-galois.c b/drivers/crypto/ccp/ccp-crypto-aes-galois.c
index f9fec2ddf56a..94c1ad7eeddf 100644
--- a/drivers/crypto/ccp/ccp-crypto-aes-galois.c
+++ b/drivers/crypto/ccp/ccp-crypto-aes-galois.c
@@ -58,6 +58,19 @@ static int ccp_aes_gcm_setkey(struct crypto_aead *tfm, const u8 *key,
static int ccp_aes_gcm_setauthsize(struct crypto_aead *tfm,
unsigned int authsize)
{
+ switch (authsize) {
+ case 16:
+ case 15:
+ case 14:
+ case 13:
+ case 12:
+ case 8:
+ case 4:
+ break;
+ default:
+ return -EINVAL;
+ }
+
return 0;
}
@@ -104,6 +117,7 @@ static int ccp_aes_gcm_crypt(struct aead_request *req, bool encrypt)
memset(&rctx->cmd, 0, sizeof(rctx->cmd));
INIT_LIST_HEAD(&rctx->cmd.entry);
rctx->cmd.engine = CCP_ENGINE_AES;
+ rctx->cmd.u.aes.authsize = crypto_aead_authsize(tfm);
rctx->cmd.u.aes.type = ctx->u.aes.type;
rctx->cmd.u.aes.mode = ctx->u.aes.mode;
rctx->cmd.u.aes.action = encrypt;
OpenPOWER on IntegriCloud