summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorBoris Pismenny <borisp@mellanox.com>2018-02-14 10:46:06 +0200
committerDavid S. Miller <davem@davemloft.net>2018-02-14 15:05:19 -0500
commita1dfa6812b682eef750412dd5a90e7d38d7af068 (patch)
tree99850708433de9870bf9aa9f356809b0eec28f90 /net/tls
parent8ace02073ee6e8c0e559f712d7784fcbd555c839 (diff)
downloadlinux-a1dfa6812b682eef750412dd5a90e7d38d7af068.tar.bz2
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@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_main.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/tls/tls_main.c b/net/tls/tls_main.c
index b0d5fcea47e7..a6c3702e0ddb 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,