Skip to content

Commit a1dfa68

Browse files
Boris Pismennydavem330
Boris Pismenny
authored andcommitted
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: 3c4d755 ("tls: kernel TLS support") Signed-off-by: Boris Pismenny <borisp@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8ace020 commit a1dfa68

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/tls/tls_main.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -308,7 +308,8 @@ static int do_tls_getsockopt_tx(struct sock *sk, char __user *optval,
308308
goto out;
309309
}
310310
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,
312313
TLS_CIPHER_AES_GCM_128_IV_SIZE);
313314
release_sock(sk);
314315
if (copy_to_user(optval,

0 commit comments

Comments
 (0)