Merge remote-tracking branch 'remotes/origin/master' into feature/ik-handshake

This commit is contained in:
Belma Gutlic
2019-12-27 14:06:05 +01:00
3 changed files with 5 additions and 16 deletions

View File

@ -11,7 +11,7 @@ const maxPlaintextLength = 65519;
export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper {
return async function * (source) {
for await (const chunk of source) {
const chunkBuffer = Buffer.from(chunk);
const chunkBuffer = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.length);
for (let i = 0; i < chunkBuffer.length; i += maxPlaintextLength) {
let end = i + maxPlaintextLength;
@ -31,7 +31,7 @@ export function encryptStream(handshake: Handshake): ReturnEncryptionWrapper {
export function decryptStream(handshake: Handshake): ReturnEncryptionWrapper {
return async function * (source) {
for await (const chunk of source) {
const chunkBuffer = Buffer.from(chunk);
const chunkBuffer = Buffer.from(chunk.buffer, chunk.byteOffset, chunk.length);
for (let i = 0; i < chunkBuffer.length; i += maxPlaintextLength) {
let end = i + maxPlaintextLength;