netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/3] tls: retrun the correct IV in getsockopt
@ 2018-02-14  8:46 Boris Pismenny
  2018-02-14  8:46 ` [PATCH 2/3] tls: reset the crypto info if copy_from_user fails Boris Pismenny
                   ` (2 more replies)
  0 siblings, 3 replies; 6+ messages in thread
From: Boris Pismenny @ 2018-02-14  8:46 UTC (permalink / raw)
  To: netdev, davem; +Cc: borisp, ilyal, aviadye

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@mellanox.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

^ permalink raw reply related	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2018-02-14 20:07 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2018-02-14  8:46 [PATCH 1/3] tls: retrun the correct IV in getsockopt Boris Pismenny
2018-02-14  8:46 ` [PATCH 2/3] tls: reset the crypto info if copy_from_user fails Boris Pismenny
2018-02-14 20:07   ` David Miller
2018-02-14  8:46 ` [PATCH 3/3] tls: getsockopt return record sequence number Boris Pismenny
2018-02-14 20:07   ` David Miller
2018-02-14 20:07 ` [PATCH 1/3] tls: retrun the correct IV in getsockopt David Miller

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).