Skip to content

Commit

Permalink
tls: rx: init decrypted status in tls_read_size()
Browse files Browse the repository at this point in the history
We set the record type in tls_read_size(), can as well init
the tlm->decrypted field there.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jakub Kicinski authored and David S. Miller committed Apr 8, 2022
1 parent 7dc59c3 commit 863533e
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions net/tls/tls_sw.c
Original file line number Diff line number Diff line change
Expand Up @@ -2101,10 +2101,10 @@ static int tls_read_size(struct strparser *strp, struct sk_buff *skb)

/* Linearize header to local buffer */
ret = skb_copy_bits(skb, rxm->offset, header, prot->prepend_size);

if (ret < 0)
goto read_failure;

tlm->decrypted = 0;
tlm->control = header[0];

data_len = ((header[4] & 0xFF) | (header[3] << 8));
Expand Down Expand Up @@ -2145,9 +2145,6 @@ static void tls_queue(struct strparser *strp, struct sk_buff *skb)
{
struct tls_context *tls_ctx = tls_get_ctx(strp->sk);
struct tls_sw_context_rx *ctx = tls_sw_ctx_rx(tls_ctx);
struct tls_msg *tlm = tls_msg(skb);

tlm->decrypted = 0;

ctx->recv_pkt = skb;
strp_pause(strp);
Expand Down

0 comments on commit 863533e

Please sign in to comment.