Skip to content

Commit

Permalink
net/tls: add missing prot info init
Browse files Browse the repository at this point in the history
Turns out TLS_TX in HW offload mode does not initialize tls_prot_info.
Since commit 9cd8198 ("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: 9cd8198 ("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>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Jul 9, 2019
1 parent c3b6491 commit ab232e6
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions net/tls/tls_device.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit ab232e6

Please sign in to comment.