Attention is currently required from: Arne Schwabe.
Hello Arne Schwabe,
I'd like you to do a code review.
Please visit
https://gerrit.openvpn.net/c/openvpn/+/2083?usp=email
to review the following change.
Change subject: tls_crypt: append cipher final output at buffer end
......................................................................
tls_crypt: append cipher final output at buffer end
tls_crypt_wrap() and tls_crypt_unwrap() passed BPTR(dst) to
cipher_ctx_final(), which would overwrite the start of dst if final
produced output. Use BEND(dst), as the tls-crypt-v2 code does.
No functional change with AES-256-CTR, whose final produces 0 bytes.
Change-Id: Ie0f902ae5aa8e549f76f2cf32facda43eac18915
Signed-off-by: Razvan Cojocaru <[email protected]>
---
M src/openvpn/tls_crypt.c
1 file changed, 2 insertions(+), 2 deletions(-)
git pull ssh://gerrit.openvpn.net:29418/openvpn refs/changes/83/2083/1
diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c
index 23c7975..d015004 100644
--- a/src/openvpn/tls_crypt.c
+++ b/src/openvpn/tls_crypt.c
@@ -191,7 +191,7 @@
int outlen = 0;
ASSERT(cipher_ctx_update(ctx->cipher, BEND(dst), &outlen, CBPTR(src),
BLEN(src)));
ASSERT(buf_inc_len(dst, outlen));
- ASSERT(cipher_ctx_final(ctx->cipher, BPTR(dst), &outlen));
+ ASSERT(cipher_ctx_final(ctx->cipher, BEND(dst), &outlen));
ASSERT(buf_inc_len(dst, outlen));
}
@@ -247,7 +247,7 @@
CRYPT_ERROR("cipher update failed");
}
ASSERT(buf_inc_len(dst, outlen));
- if (!cipher_ctx_final(ctx->cipher, BPTR(dst), &outlen))
+ if (!cipher_ctx_final(ctx->cipher, BEND(dst), &outlen))
{
CRYPT_ERROR("cipher final failed");
}
--
To view, visit https://gerrit.openvpn.net/c/openvpn/+/2083?usp=email
To unsubscribe, or for help writing mail filters, visit
https://gerrit.openvpn.net/settings?usp=email
Gerrit-MessageType: newchange
Gerrit-Project: openvpn
Gerrit-Branch: master
Gerrit-Change-Id: Ie0f902ae5aa8e549f76f2cf32facda43eac18915
Gerrit-Change-Number: 2083
Gerrit-PatchSet: 1
Gerrit-Owner: Răzvan Cojocaru <[email protected]>
Gerrit-Reviewer: Arne Schwabe <[email protected]>
Gerrit-CC: openvpn-devel <[email protected]>
Gerrit-Attention: Arne Schwabe <[email protected]>
_______________________________________________
Openvpn-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/openvpn-devel