aboutsummaryrefslogtreecommitdiffstats
path: root/include/net/tls.h
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2023-10-09 22:50:45 +0200
committerDavid S. Miller <davem@davemloft.net>2023-10-13 11:26:10 +0100
commit1c1cb3110d7ed2897e65d9a352a8fb709723e057 (patch)
tree62d5148e58b862da82f0f027b7b2ea225d81697c /include/net/tls.h
parenttls: rename MAX_IV_SIZE to TLS_MAX_IV_SIZE (diff)
downloadlinux-1c1cb3110d7ed2897e65d9a352a8fb709723e057.tar.xz
linux-1c1cb3110d7ed2897e65d9a352a8fb709723e057.zip
tls: store iv directly within cipher_context
TLS_MAX_IV_SIZE + TLS_MAX_SALT_SIZE is 20B, we don't get much benefit in cipher_context's size and can simplify the init code a bit. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/net/tls.h')
-rw-r--r--include/net/tls.h3
1 files changed, 2 insertions, 1 deletions
diff --git a/include/net/tls.h b/include/net/tls.h
index 5200ce27db91..28cc40d7b945 100644
--- a/include/net/tls.h
+++ b/include/net/tls.h
@@ -62,6 +62,7 @@ struct tls_rec;
#define TLS_AAD_SPACE_SIZE 13
#define TLS_MAX_IV_SIZE 16
+#define TLS_MAX_SALT_SIZE 4
#define TLS_TAG_SIZE 16
#define TLS_MAX_REC_SEQ_SIZE 8
#define TLS_MAX_AAD_SIZE TLS_AAD_SPACE_SIZE
@@ -193,7 +194,7 @@ enum tls_context_flags {
};
struct cipher_context {
- char *iv;
+ char iv[TLS_MAX_IV_SIZE + TLS_MAX_SALT_SIZE];
char rec_seq[TLS_MAX_REC_SEQ_SIZE];
};