Commit a491b932 authored by Atul Gupta's avatar Atul Gupta Committed by David S. Miller

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: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarAtul Gupta <atul.gupta@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 4d0312e0
...@@ -213,7 +213,7 @@ static int chtls_key_info(struct chtls_sock *csk, ...@@ -213,7 +213,7 @@ static int chtls_key_info(struct chtls_sock *csk,
struct _key_ctx *kctx, struct _key_ctx *kctx,
u32 keylen, u32 optname) u32 keylen, u32 optname)
{ {
unsigned char key[CHCR_KEYCTX_CIPHER_KEY_SIZE_256]; unsigned char key[AES_KEYSIZE_128];
struct tls12_crypto_info_aes_gcm_128 *gcm_ctx; struct tls12_crypto_info_aes_gcm_128 *gcm_ctx;
unsigned char ghash_h[AEAD_H_SIZE]; unsigned char ghash_h[AEAD_H_SIZE];
struct crypto_cipher *cipher; struct crypto_cipher *cipher;
...@@ -228,10 +228,6 @@ static int chtls_key_info(struct chtls_sock *csk, ...@@ -228,10 +228,6 @@ static int chtls_key_info(struct chtls_sock *csk,
if (keylen == AES_KEYSIZE_128) { if (keylen == AES_KEYSIZE_128) {
ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128; ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_128;
} else if (keylen == AES_KEYSIZE_192) {
ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_192;
} else if (keylen == AES_KEYSIZE_256) {
ck_size = CHCR_KEYCTX_CIPHER_KEY_SIZE_256;
} else { } else {
pr_err("GCM: Invalid key length %d\n", keylen); pr_err("GCM: Invalid key length %d\n", keylen);
return -EINVAL; return -EINVAL;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment