summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-04-11 21:19:16 +0200
committerDavid S. Miller <davem@davemloft.net>2022-04-13 12:45:39 +0200
commitf7d45f4b52fe259c152139f1f6b2f80474b7b96f (patch)
treece3a75e4658911fa6c3327da413e1ff751db0cf0 /net/tls
parenttls: rx: use async as an in-out argument (diff)
downloadlinux-f7d45f4b52fe259c152139f1f6b2f80474b7b96f.tar.xz
linux-f7d45f4b52fe259c152139f1f6b2f80474b7b96f.zip
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>
Diffstat (limited to 'net/tls')
-rw-r--r--net/tls/tls_sw.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 2f44f57f216a..465d902f5bb9 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -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.