[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <1518597968-72686-1-git-send-email-borisp@mellanox.com>
Date: Wed, 14 Feb 2018 10:46:06 +0200
From: Boris Pismenny <borisp@...lanox.com>
To: netdev@...r.kernel.org, davem@...emloft.net
Cc: borisp@...lanox.com, ilyal@...lanox.com, aviadye@...lanox.com
Subject: [PATCH 1/3] tls: retrun the correct IV in getsockopt
Current code returns four bytes of salt followed by four bytes of IV.
This patch returns all eight bytes of IV.
fixes: 3c4d7559159b ("tls: kernel TLS support")
Signed-off-by: Boris Pismenny <borisp@...lanox.com>
---
net/tls/tls_main.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index b0d5fce..a6c3702 100644
--- a/net/tls/tls_main.c
+++ b/net/tls/tls_main.c
@@ -308,7 +308,8 @@ static int do_tls_getsockopt_tx(struct sock *sk, char __user *optval,
goto out;
}
lock_sock(sk);
- memcpy(crypto_info_aes_gcm_128->iv, ctx->iv,
+ memcpy(crypto_info_aes_gcm_128->iv,
+ ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE,
TLS_CIPHER_AES_GCM_128_IV_SIZE);
release_sock(sk);
if (copy_to_user(optval,
--
1.8.3.1
Powered by blists - more mailing lists