LibTLS: Fix TLS breakage after ByteBuffer => Span conversion

Oops, I accidentally shadowed the outer scope's "decrypted" ByteBuffer
which caused us to throw away the buffer too early.

Fixes #4533.
This commit is contained in:
Andreas Kling 2020-12-26 16:06:27 +01:00
parent bdff88d8d5
commit 3be9a9ac76
Notes: sideshowbarker 2024-07-19 00:34:50 +09:00

View file

@ -343,7 +343,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer)
ASSERT(m_aes_remote.cbc);
auto iv_size = iv_length();
auto decrypted = m_aes_remote.cbc->create_aligned_buffer(length - iv_size);
decrypted = m_aes_remote.cbc->create_aligned_buffer(length - iv_size);
auto iv = buffer.slice(header_size, iv_size);
Bytes decrypted_span = decrypted;
@ -383,7 +383,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer)
return (i8)Error::IntegrityCheckFailed;
}
plain = decrypted.slice(0, length);
plain = decrypted.bytes().slice(0, length);
}
}
m_context.remote_sequence_number++;