OSDN Git Service

tls: rx: read the input skb from ctx->recv_pkt
authorJakub Kicinski <kuba@kernel.org>
Fri, 15 Jul 2022 05:22:30 +0000 (22:22 -0700)
committerDavid S. Miller <davem@davemloft.net>
Mon, 18 Jul 2022 10:24:11 +0000 (11:24 +0100)
commit541cc48be3b141e8529fef05ad6cedbca83f9e80
tree37bbdfc174258b2baa5342a4d74ffddcc159f1c8
parent8a958732818bc27f7da4d41ecf2c5c99d9aa8b0e
tls: rx: read the input skb from ctx->recv_pkt

Callers always pass ctx->recv_pkt into decrypt_skb_update(),
and it propagates it to its callees. This may give someone
the false impression that those functions can accept any valid
skb containing a TLS record. That's not the case, the record
sequence number is read from the context, and they can only
take the next record coming out of the strp.

Let the functions get the skb from the context instead of
passing it in. This will also make it cleaner to return
a different skb than ctx->recv_pkt as the decrypted one
later on.

Since we're touching the definition of decrypt_skb_update()
use this as an opportunity to rename it.

Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/tls/tls.h
net/tls/tls_device.c
net/tls/tls_sw.c