diff options
author | Jakub Kicinski <jakub.kicinski@netronome.com> | 2019-07-09 04:53:15 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2019-07-09 05:21:09 +0200 |
commit | ab232e61e728a08a2cb4ebb439d7d2aa75df89c9 (patch) | |
tree | aa5edb6066f16ea850e6f36fb7161a3f9e3b171b /net/tls | |
parent | nfp: tls: don't leave key material in freed FW cmsg skbs (diff) | |
download | linux-ab232e61e728a08a2cb4ebb439d7d2aa75df89c9.tar.xz linux-ab232e61e728a08a2cb4ebb439d7d2aa75df89c9.zip |
net/tls: add missing prot info init
Turns out TLS_TX in HW offload mode does not initialize tls_prot_info.
Since commit 9cd81988cce1 ("net/tls: use version from prot") we actually
use this field on the datapath. Luckily we always compare it to TLS 1.3,
and assume 1.2 otherwise. So since zero is not equal to 1.3, everything
worked fine.
Fixes: 9cd81988cce1 ("net/tls: use version from prot")
Signed-off-by: Jakub Kicinski <jakub.kicinski@netronome.com>
Reviewed-by: Dirk van der Merwe <dirk.vandermerwe@netronome.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/tls')
-rw-r--r-- | net/tls/tls_device.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/net/tls/tls_device.c b/net/tls/tls_device.c index 77fa3b5f2b49..7c0b2b778703 100644 --- a/net/tls/tls_device.c +++ b/net/tls/tls_device.c @@ -883,6 +883,8 @@ int tls_set_device_offload(struct sock *sk, struct tls_context *ctx) goto free_offload_ctx; } + prot->version = crypto_info->version; + prot->cipher_type = crypto_info->cipher_type; prot->prepend_size = TLS_HEADER_SIZE + nonce_size; prot->tag_size = tag_size; prot->overhead_size = prot->prepend_size + prot->tag_size; |