diff options
author | Atul Gupta <atul.gupta@chelsio.com> | 2018-05-27 11:45:18 -0400 |
---|---|---|
committer | Herbert Xu <herbert@gondor.apana.org.au> | 2018-05-30 12:13:58 -0400 |
commit | 09e53d8289477449ddd74cfff640792ca02fa90d (patch) | |
tree | 6f545a4a319761a2c90531ecd83f2c7d46cfbbba | |
parent | 015a03704df11c552501e0b52cc264b5c57a9a41 (diff) |
crypto: chtls - key len correction
corrected the key length to copy 128b key. Removed 192b and 256b
key as user input supports key of size 128b in gcm_ctx
Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Atul Gupta <atul.gupta@chelsio.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
-rw-r--r-- | drivers/crypto/chelsio/chtls/chtls_hw.c | 6 |
1 files changed, 1 insertions, 5 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_hw.c b/drivers/crypto/chelsio/chtls/chtls_hw.c index 54a13aa99121..55d50140f9e5 100644 --- a/drivers/crypto/chelsio/chtls/chtls_hw.c +++ b/drivers/crypto/chelsio/chtls/chtls_hw.c | |||
@@ -213,7 +213,7 @@ static int chtls_key_info(struct chtls_sock *csk, | |||
213 | struct _key_ctx *kctx, | 213 | struct _key_ctx *kctx, |
214 | u32 keylen, u32 optname) | 214 | u32 keylen, u32 optname) |
215 | { | 215 | { |
216 | unsigned char key[CHCR_KEYCTX_CIPHER_KEY_SIZE_256]; | 216 | unsigned char key[AES_KEYSIZE_128]; |
217 | struct tls12_crypto_info_aes_gcm_128 *gcm_ctx; | 217 | struct tls12_crypto_info_aes_gcm_128 *gcm_ctx; |
218 | unsigned char ghash_h[AEAD_H_SIZE]; | 218 | unsigned char ghash_h[AEAD_H_SIZE]; |
219 | struct crypto_cipher *cipher; | 219 | struct crypto_cipher *cipher; |
@@ -228,10 +228,6 @@ static int chtls_key_info(struct chtls_sock *csk, | |||
228 | 228 | ||
229 | if (keylen == AES_KEYSIZE_128) { | 229 | if (keylen == AES_KEYSIZE_128) { |
230 | ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128; | 230 | ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128; |
231 | } else if (keylen == AES_KEYSIZE_192) { | ||
232 | ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_192; | ||
233 | } else if (keylen == AES_KEYSIZE_256) { | ||
234 | ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256; | ||
235 | } else { | 231 | } else { |
236 | pr_err("GCM: Invalid key length %d\n", keylen); | 232 | pr_err("GCM: Invalid key length %d\n", keylen); |
237 | return -EINVAL; | 233 | return -EINVAL; |