summaryrefslogtreecommitdiff
path: root/include/net/tls.h
diff options
context:
space:
mode:
authorTariq Toukan <tariqt@nvidia.com>2022-09-20 16:01:47 +0300
committerJakub Kicinski <kuba@kernel.org>2022-09-23 03:27:41 +0300
commit2d2c5ea24243eb3ed12f232b2aef43981fa15360 (patch)
treebd7ca3a1b9ac1df33fcbb97a7a2f79142970a117 /include/net/tls.h
parent8db3d514e96715c897fe793c4d5fc0fd86aca517 (diff)
downloadlinux-2d2c5ea24243eb3ed12f232b2aef43981fa15360.tar.xz
net/tls: Describe ciphers sizes by const structs
Introduce cipher sizes descriptor. It helps reducing the amount of code duplications and repeated switch/cases that assigns the proper sizes according to the cipher type. Signed-off-by: Tariq Toukan <tariqt@nvidia.com> Signed-off-by: Gal Pressman <gal@nvidia.com> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r--include/net/tls.h10
1 files changed, 10 insertions, 0 deletions
diff --git a/include/net/tls.h b/include/net/tls.h
index cb205f9d9473..154949c7b0c8 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -51,6 +51,16 @@
struct tls_rec;
+struct tls_cipher_size_desc {
+ unsigned int iv;
+ unsigned int key;
+ unsigned int salt;
+ unsigned int tag;
+ unsigned int rec_seq;
+};
+
+extern const struct tls_cipher_size_desc tls_cipher_size_desc[];
+
/* Maximum data size carried in a TLS record */
#define TLS_MAX_PAYLOAD_SIZE ((size_t)1 << 14)