Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

tls: rename MAX_IV_SIZE to TLS_MAX_IV_SIZE

It's defined in include/net/tls.h, avoid using an overly generic name.

Signed-off-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Sabrina Dubroca and committed by
David S. Miller
bee6b7b3 6d5029e5

+7 -7
+1 -1
include/net/tls.h
··· 61 61 62 62 #define TLS_AAD_SPACE_SIZE 13 63 63 64 - #define MAX_IV_SIZE 16 64 + #define TLS_MAX_IV_SIZE 16 65 65 #define TLS_TAG_SIZE 16 66 66 #define TLS_MAX_REC_SEQ_SIZE 8 67 67 #define TLS_MAX_AAD_SIZE TLS_AAD_SPACE_SIZE
+1 -1
net/tls/tls.h
··· 127 127 struct sock *sk; 128 128 129 129 char aad_space[TLS_AAD_SPACE_SIZE]; 130 - u8 iv_data[MAX_IV_SIZE]; 130 + u8 iv_data[TLS_MAX_IV_SIZE]; 131 131 struct aead_request aead_req; 132 132 u8 aead_req_ctx[]; 133 133 };
+1 -1
net/tls/tls_device_fallback.c
··· 54 54 struct scatter_walk *out, int *in_len, 55 55 struct tls_prot_info *prot) 56 56 { 57 - unsigned char buf[TLS_HEADER_SIZE + MAX_IV_SIZE]; 57 + unsigned char buf[TLS_HEADER_SIZE + TLS_MAX_IV_SIZE]; 58 58 const struct tls_cipher_desc *cipher_desc; 59 59 struct scatterlist sg_in[3]; 60 60 struct scatterlist sg_out[3];
+1 -1
net/tls/tls_main.c
··· 59 59 }; 60 60 61 61 #define CHECK_CIPHER_DESC(cipher,ci) \ 62 - static_assert(cipher ## _IV_SIZE <= MAX_IV_SIZE); \ 62 + static_assert(cipher ## _IV_SIZE <= TLS_MAX_IV_SIZE); \ 63 63 static_assert(cipher ## _REC_SEQ_SIZE <= TLS_MAX_REC_SEQ_SIZE); \ 64 64 static_assert(cipher ## _TAG_SIZE == TLS_TAG_SIZE); \ 65 65 static_assert(sizeof_field(struct ci, iv) == cipher ## _IV_SIZE); \
+3 -3
net/tls/tls_sw.c
··· 60 60 61 61 struct tls_decrypt_ctx { 62 62 struct sock *sk; 63 - u8 iv[MAX_IV_SIZE]; 63 + u8 iv[TLS_MAX_IV_SIZE]; 64 64 u8 aad[TLS_MAX_AAD_SIZE]; 65 65 u8 tail; 66 66 struct scatterlist sg[]; ··· 2319 2319 { 2320 2320 struct tls_context *tls_ctx = tls_get_ctx(strp->sk); 2321 2321 struct tls_prot_info *prot = &tls_ctx->prot_info; 2322 - char header[TLS_HEADER_SIZE + MAX_IV_SIZE]; 2322 + char header[TLS_HEADER_SIZE + TLS_MAX_IV_SIZE]; 2323 2323 size_t cipher_overhead; 2324 2324 size_t data_len = 0; 2325 2325 int ret; ··· 2669 2669 } 2670 2670 2671 2671 /* Sanity-check the sizes for stack allocations. */ 2672 - if (nonce_size > MAX_IV_SIZE || prot->aad_size > TLS_MAX_AAD_SIZE) { 2672 + if (nonce_size > TLS_MAX_IV_SIZE || prot->aad_size > TLS_MAX_AAD_SIZE) { 2673 2673 rc = -EINVAL; 2674 2674 goto free_priv; 2675 2675 }