Commit bee6b7b3 authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by David S. Miller

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: default avatarSabrina Dubroca <sd@queasysnail.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 6d5029e5
...@@ -61,7 +61,7 @@ struct tls_rec; ...@@ -61,7 +61,7 @@ struct tls_rec;
#define TLS_AAD_SPACE_SIZE 13 #define TLS_AAD_SPACE_SIZE 13
#define MAX_IV_SIZE 16 #define TLS_MAX_IV_SIZE 16
#define TLS_TAG_SIZE 16 #define TLS_TAG_SIZE 16
#define TLS_MAX_REC_SEQ_SIZE 8 #define TLS_MAX_REC_SEQ_SIZE 8
#define TLS_MAX_AAD_SIZE TLS_AAD_SPACE_SIZE #define TLS_MAX_AAD_SIZE TLS_AAD_SPACE_SIZE
......
...@@ -127,7 +127,7 @@ struct tls_rec { ...@@ -127,7 +127,7 @@ struct tls_rec {
struct sock *sk; struct sock *sk;
char aad_space[TLS_AAD_SPACE_SIZE]; char aad_space[TLS_AAD_SPACE_SIZE];
u8 iv_data[MAX_IV_SIZE]; u8 iv_data[TLS_MAX_IV_SIZE];
struct aead_request aead_req; struct aead_request aead_req;
u8 aead_req_ctx[]; u8 aead_req_ctx[];
}; };
......
...@@ -54,7 +54,7 @@ static int tls_enc_record(struct aead_request *aead_req, ...@@ -54,7 +54,7 @@ static int tls_enc_record(struct aead_request *aead_req,
struct scatter_walk *out, int *in_len, struct scatter_walk *out, int *in_len,
struct tls_prot_info *prot) struct tls_prot_info *prot)
{ {
unsigned char buf[TLS_HEADER_SIZE + MAX_IV_SIZE]; unsigned char buf[TLS_HEADER_SIZE + TLS_MAX_IV_SIZE];
const struct tls_cipher_desc *cipher_desc; const struct tls_cipher_desc *cipher_desc;
struct scatterlist sg_in[3]; struct scatterlist sg_in[3];
struct scatterlist sg_out[3]; struct scatterlist sg_out[3];
......
...@@ -59,7 +59,7 @@ enum { ...@@ -59,7 +59,7 @@ enum {
}; };
#define CHECK_CIPHER_DESC(cipher,ci) \ #define CHECK_CIPHER_DESC(cipher,ci) \
static_assert(cipher ## _IV_SIZE <= MAX_IV_SIZE); \ static_assert(cipher ## _IV_SIZE <= TLS_MAX_IV_SIZE); \
static_assert(cipher ## _REC_SEQ_SIZE <= TLS_MAX_REC_SEQ_SIZE); \ static_assert(cipher ## _REC_SEQ_SIZE <= TLS_MAX_REC_SEQ_SIZE); \
static_assert(cipher ## _TAG_SIZE == TLS_TAG_SIZE); \ static_assert(cipher ## _TAG_SIZE == TLS_TAG_SIZE); \
static_assert(sizeof_field(struct ci, iv) == cipher ## _IV_SIZE); \ static_assert(sizeof_field(struct ci, iv) == cipher ## _IV_SIZE); \
......
...@@ -60,7 +60,7 @@ struct tls_decrypt_arg { ...@@ -60,7 +60,7 @@ struct tls_decrypt_arg {
struct tls_decrypt_ctx { struct tls_decrypt_ctx {
struct sock *sk; struct sock *sk;
u8 iv[MAX_IV_SIZE]; u8 iv[TLS_MAX_IV_SIZE];
u8 aad[TLS_MAX_AAD_SIZE]; u8 aad[TLS_MAX_AAD_SIZE];
u8 tail; u8 tail;
struct scatterlist sg[]; struct scatterlist sg[];
...@@ -2319,7 +2319,7 @@ int tls_rx_msg_size(struct tls_strparser *strp, struct sk_buff *skb) ...@@ -2319,7 +2319,7 @@ int tls_rx_msg_size(struct tls_strparser *strp, struct sk_buff *skb)
{ {
struct tls_context *tls_ctx = tls_get_ctx(strp->sk); struct tls_context *tls_ctx = tls_get_ctx(strp->sk);
struct tls_prot_info *prot = &tls_ctx->prot_info; struct tls_prot_info *prot = &tls_ctx->prot_info;
char header[TLS_HEADER_SIZE + MAX_IV_SIZE]; char header[TLS_HEADER_SIZE + TLS_MAX_IV_SIZE];
size_t cipher_overhead; size_t cipher_overhead;
size_t data_len = 0; size_t data_len = 0;
int ret; int ret;
...@@ -2669,7 +2669,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx) ...@@ -2669,7 +2669,7 @@ int tls_set_sw_offload(struct sock *sk, struct tls_context *ctx, int tx)
} }
/* Sanity-check the sizes for stack allocations. */ /* Sanity-check the sizes for stack allocations. */
if (nonce_size > MAX_IV_SIZE || prot->aad_size > TLS_MAX_AAD_SIZE) { if (nonce_size > TLS_MAX_IV_SIZE || prot->aad_size > TLS_MAX_AAD_SIZE) {
rc = -EINVAL; rc = -EINVAL;
goto free_priv; goto free_priv;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment