diff options
author | Vinay Kumar Yadav <vinay.yadav@chelsio.com> | 2020-07-17 22:01:42 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2020-07-21 04:27:40 +0300 |
commit | c271042eb6a031d1333cf57422ec1d20726901ab (patch) | |
tree | bdc8d25d5d02b6c54d6ced7bc3fc1c87c5f59127 /drivers/crypto/chelsio | |
parent | 4932893924e9b9cdca8fcee2b87a4fa241cd95e8 (diff) | |
download | linux-c271042eb6a031d1333cf57422ec1d20726901ab.tar.xz |
crypto/chtls: fix tls alert messages corrupted by tls data
When tls data skb is pending for Tx and tls alert comes , It
is wrongly overwrite the record type of tls data to tls alert
record type. fix the issue correcting it.
v1->v2:
- Correct submission tree.
- Add fixes tag.
Fixes: 6919a8264a32 ("Crypto/chtls: add/delete TLS header in driver")
Signed-off-by: Vinay Kumar Yadav <vinay.yadav@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/crypto/chelsio')
-rw-r--r-- | drivers/crypto/chelsio/chtls/chtls_io.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/drivers/crypto/chelsio/chtls/chtls_io.c b/drivers/crypto/chelsio/chtls/chtls_io.c index e1401d9cc756..2e9acae1cba3 100644 --- a/drivers/crypto/chelsio/chtls/chtls_io.c +++ b/drivers/crypto/chelsio/chtls/chtls_io.c @@ -1052,14 +1052,15 @@ int chtls_sendmsg(struct sock *sk, struct msghdr *msg, size_t size) &record_type); if (err) goto out_err; + + /* Avoid appending tls handshake, alert to tls data */ + if (skb) + tx_skb_finalize(skb); } recordsz = size; csk->tlshws.txleft = recordsz; csk->tlshws.type = record_type; - - if (skb) - ULP_SKB_CB(skb)->ulp.tls.type = record_type; } if (!skb || (ULP_SKB_CB(skb)->flags & ULPCB_FLAG_NO_APPEND) || |