diff options
author | Boris Pismenny <borisp@mellanox.com> | 2018-02-14 09:46:06 +0100 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2018-02-14 21:05:19 +0100 |
commit | a1dfa6812b682eef750412dd5a90e7d38d7af068 (patch) | |
tree | 99850708433de9870bf9aa9f356809b0eec28f90 /net/tls | |
parent | Merge branch 'net-segmentation-offload-doc-fixes' (diff) | |
download | linux-a1dfa6812b682eef750412dd5a90e7d38d7af068.tar.xz linux-a1dfa6812b682eef750412dd5a90e7d38d7af068.zip |
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.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, 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, |