summaryrefslogtreecommitdiffstats
path: root/net/tls
diff options
context:
space:
mode:
authorJakub Kicinski <kuba@kernel.org>2022-07-06 01:59:22 +0200
committerDavid S. Miller <davem@davemloft.net>2022-07-06 13:56:35 +0200
commit603380f54f837a7837c30713de25cb146254a0d7 (patch)
treee2c2f98193bf5a70af63211103a85ad7c11432ac /net/tls
parentMerge branch 'octeontx2-af-next' (diff)
downloadlinux-603380f54f837a7837c30713de25cb146254a0d7.tar.xz
linux-603380f54f837a7837c30713de25cb146254a0d7.zip
tls: rx: don't include tail size in data_len
To make future patches easier to review make data_len contain the length of the data, without the tail. 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.c8
1 files changed, 4 insertions, 4 deletions
diff --git a/net/tls/tls_sw.c b/net/tls/tls_sw.c
index 0513f82b8537..7fcb54e43a08 100644
--- a/net/tls/tls_sw.c
+++ b/net/tls/tls_sw.c
@@ -1423,8 +1423,7 @@ static int decrypt_internal(struct sock *sk, struct sk_buff *skb,
u8 *aad, *iv, *mem = NULL;
struct scatterlist *sgin = NULL;
struct scatterlist *sgout = NULL;
- const int data_len = rxm->full_len - prot->overhead_size +
- prot->tail_size;
+ const int data_len = rxm->full_len - prot->overhead_size;
int iv_offset = 0;
if (darg->zc && (out_iov || out_sg)) {
@@ -1519,7 +1518,8 @@ static int decrypt_internal(struct sock *sk, struct sk_buff *skb,
sg_init_table(sgout, n_sgout);
sg_set_buf(&sgout[0], aad, prot->aad_size);
- err = tls_setup_from_iter(out_iov, data_len,
+ err = tls_setup_from_iter(out_iov,
+ data_len + prot->tail_size,
&pages, &sgout[1],
(n_sgout - 1));
if (err < 0)
@@ -1538,7 +1538,7 @@ fallback_to_reg_recv:
/* Prepare and submit AEAD request */
err = tls_do_decryption(sk, skb, sgin, sgout, iv,
- data_len, aead_req, darg);
+ data_len + prot->tail_size, aead_req, darg);
if (darg->async)
return 0;