diff options
author | Sabrina Dubroca <sd@queasysnail.net> | 2023-10-09 23:50:45 +0300 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-13 13:26:10 +0300 |
commit | 1c1cb3110d7ed2897e65d9a352a8fb709723e057 (patch) | |
tree | 62d5148e58b862da82f0f027b7b2ea225d81697c /include/net/tls.h | |
parent | bee6b7b30706e7693d91cb28c8ff3cb69e094f65 (diff) | |
download | linux-1c1cb3110d7ed2897e65d9a352a8fb709723e057.tar.xz |
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.h | 3 |
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]; }; |