Gert Doering has submitted this change. ( https://gerrit.openvpn.net/c/openvpn/+/2083?usp=email )
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]> Acked-by: Arne Schwabe <[email protected]> Gerrit URL: https://gerrit.openvpn.net/c/openvpn/+/2083 Message-Id: <[email protected]> URL: https://www.mail-archive.com/[email protected]/msg40536.html Signed-off-by: Gert Doering <[email protected]> --- M src/openvpn/tls_crypt.c 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/openvpn/tls_crypt.c b/src/openvpn/tls_crypt.c index 447262c..99e2411 100644 --- a/src/openvpn/tls_crypt.c +++ b/src/openvpn/tls_crypt.c @@ -188,7 +188,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)); } @@ -244,7 +244,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: merged Gerrit-Project: openvpn Gerrit-Branch: master Gerrit-Change-Id: Ie0f902ae5aa8e549f76f2cf32facda43eac18915 Gerrit-Change-Number: 2083 Gerrit-PatchSet: 3 Gerrit-Owner: Răzvan Cojocaru <[email protected]> Gerrit-Reviewer: Arne Schwabe <[email protected]> Gerrit-CC: openvpn-devel <[email protected]>
_______________________________________________ Openvpn-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/openvpn-devel
