tls: rx: only copy IV from the packet for TLS 1.2
authorJakub Kicinski <kuba@kernel.org>
Mon, 11 Apr 2022 19:19:17 +0000 (12:19 -0700)
committerDavid S. Miller <davem@davemloft.net>
Wed, 13 Apr 2022 10:45:39 +0000 (11:45 +0100)
commita4ae58cdb6e8ed6b00428f65515d5948e1b56deb
tree72688c7f291ba8b5e0b231f838d9a448081133f7
parentf7d45f4b52fe259c152139f1f6b2f80474b7b96f
tls: rx: only copy IV from the packet for TLS 1.2

TLS 1.3 and ChaChaPoly don't carry IV in the packet.
The code before this change would copy out iv_size
worth of whatever followed the TLS header in the packet
and then for TLS 1.3 | ChaCha overwrite that with
the sequence number. Waste of cycles especially
with TLS 1.2 being close to dead and TLS 1.3 being
the common case.

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