diff options
author | Boris Pismenny <borisp@mellanox.com> | 2018-02-14 03:46:06 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 15:05:19 -0500 |
commit | a1dfa6812b682eef750412dd5a90e7d38d7af068 (patch) | |
tree | 99850708433de9870bf9aa9f356809b0eec28f90 /net/tls/tls_main.c | |
parent | 8ace02073ee6e8c0e559f712d7784fcbd555c839 (diff) |
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/tls_main.c')
-rw-r--r-- | net/tls/tls_main.c | 3 |
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, | |||
308 | goto out; | 308 | goto out; |
309 | } | 309 | } |
310 | lock_sock(sk); | 310 | lock_sock(sk); |
311 | memcpy(crypto_info_aes_gcm_128->iv, ctx->iv, | 311 | memcpy(crypto_info_aes_gcm_128->iv, |
312 | ctx->iv + TLS_CIPHER_AES_GCM_128_SALT_SIZE, | ||
312 | TLS_CIPHER_AES_GCM_128_IV_SIZE); | 313 | TLS_CIPHER_AES_GCM_128_IV_SIZE); |
313 | release_sock(sk); | 314 | release_sock(sk); |
314 | if (copy_to_user(optval, | 315 | if (copy_to_user(optval, |