OSDN Git Service

tls: expand use of tls_cipher_desc in tls_set_device_offload
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 25 Aug 2023 21:35:15 +0000 (23:35 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 28 Aug 2023 00:17:41 +0000 (17:17 -0700)
commit3524dd4d5f1fb9e75fdfaf280822a34fa82059bd
treef1a92f9b5508023b0490c5820fb192d849f8fd5a
parent0d98cc02022d60004f78f6e7e6cc1bd39db80ef9
tls: expand use of tls_cipher_desc in tls_set_device_offload

tls_set_device_offload is already getting iv and rec_seq sizes from
tls_cipher_desc. We can now also check if the cipher_type coming from
userspace is valid and can be offloaded.

We can also remove the runtime check on rec_seq, since we validate it
at compile time.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Link: https://lore.kernel.org/r/8ab71b8eca856c7aaf981a45fe91ac649eb0e2e9.1692977948.git.sd@queasysnail.net
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/tls/tls_device.c