Date: Fri, 5 Mar 2021 03:46:32 GMT From: Mark Johnston <markj@FreeBSD.org> To: src-committers@FreeBSD.org, dev-commits-src-all@FreeBSD.org, dev-commits-src-main@FreeBSD.org Subject: git: ff6a7e4ba6bf - main - ktls: Fix CBC encryption when input and output iov sizes are different Message-ID: <202103050346.1253kW7I050046@gitrepo.freebsd.org>
next in thread | raw e-mail | index | archive | help
The branch main has been updated by markj: URL: https://cgit.FreeBSD.org/src/commit/?id=ff6a7e4ba6bf8be9ead9e1bc5537709243390654 commit ff6a7e4ba6bf8be9ead9e1bc5537709243390654 Author: Mark Johnston <markj@FreeBSD.org> AuthorDate: 2021-03-05 03:45:40 +0000 Commit: Mark Johnston <markj@FreeBSD.org> CommitDate: 2021-03-05 03:45:40 +0000 ktls: Fix CBC encryption when input and output iov sizes are different Reported by: gallatin Tested by: gallatin Fixes: 49f6925ca Differential Revision: https://reviews.freebsd.org/D29073 --- sys/opencrypto/ktls_ocf.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/sys/opencrypto/ktls_ocf.c b/sys/opencrypto/ktls_ocf.c index 31d787c2b61b..7414e26bb3e2 100644 --- a/sys/opencrypto/ktls_ocf.c +++ b/sys/opencrypto/ktls_ocf.c @@ -298,8 +298,8 @@ ktls_ocf_tls_cbc_encrypt(struct ktls_session *tls, memcpy(crp.crp_iv, hdr + 1, AES_BLOCK_LEN); crypto_use_uio(&crp, &uio); if (!inplace) { - memcpy(out_iov, outiov, sizeof(*iniov) * outiovcnt); - out_iov[outiovcnt] = iov[outiovcnt + 1]; + memcpy(out_iov, outiov, sizeof(*outiov) * outiovcnt); + out_iov[outiovcnt] = iov[iniovcnt + 1]; out_uio.uio_iov = out_iov; out_uio.uio_iovcnt = outiovcnt + 1; out_uio.uio_offset = 0;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?202103050346.1253kW7I050046>