tls: use tls_cipher_desc to simplify do_tls_getsockopt_conf
authorSabrina Dubroca <sd@queasysnail.net>
Fri, 25 Aug 2023 21:35:19 +0000 (23:35 +0200)
committerJakub Kicinski <kuba@kernel.org>
Mon, 28 Aug 2023 00:17:42 +0000 (17:17 -0700)
commit077e05d135489e144d9e0d01454886bf613d32a4
tree57fecc38f0cba02f0e11856201d5241ce99adb58
parent5f309ade49c7068b1149ecf825c4c16e56a3b865
tls: use tls_cipher_desc to simplify do_tls_getsockopt_conf

Every cipher uses the same code to update its crypto_info struct based
on the values contained in the cctx, with only the struct type and
size/offset changing. We can get those  from tls_cipher_desc, and use
a single pair of memcpy and final copy_to_user.

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