Commit ff6a7e4b authored by Mark Johnston's avatar Mark Johnston
Browse files

ktls: Fix CBC encryption when input and output iov sizes are different

Reported by:	gallatin
Tested by:	gallatin
Fixes:		49f6925c
Differential Revision:	https://reviews.freebsd.org/D29073
parent 0d3b3bee
......@@ -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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment