Commit f7d45f4b authored by Jakub Kicinski's avatar Jakub Kicinski Committed by David S. Miller
Browse files

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: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3547a1f9
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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);
	mem_size = aead_size + (nsg * sizeof(struct scatterlist));
	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
	 * aead_req || sgin[] || sgout[] || aad || iv.