tls: rx: use MAX_IV_SIZE for allocations
IVs are 8 or 16 bytes, no point reading out the exact value for quantities this small. Signed-off-by: Jakub Kicinski <kuba@kernel.org> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
3547a1f9d9
commit
f7d45f4b52
@ -1452,7 +1452,7 @@ static int decrypt_internal(struct sock *sk, struct sk_buff *skb,
|
|||||||
aead_size = sizeof(*aead_req) + crypto_aead_reqsize(ctx->aead_recv);
|
aead_size = sizeof(*aead_req) + crypto_aead_reqsize(ctx->aead_recv);
|
||||||
mem_size = aead_size + (nsg * sizeof(struct scatterlist));
|
mem_size = aead_size + (nsg * sizeof(struct scatterlist));
|
||||||
mem_size = mem_size + prot->aad_size;
|
mem_size = mem_size + prot->aad_size;
|
||||||
mem_size = mem_size + crypto_aead_ivsize(ctx->aead_recv);
|
mem_size = mem_size + MAX_IV_SIZE;
|
||||||
|
|
||||||
/* Allocate a single block of memory which contains
|
/* Allocate a single block of memory which contains
|
||||||
* aead_req || sgin[] || sgout[] || aad || iv.
|
* aead_req || sgin[] || sgout[] || aad || iv.
|
||||||
|
Loading…
Reference in New Issue
Block a user