diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2021-02-07 07:21:32 +0330 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-04-03 11:22:01 +0200 |
commit | 2020176f0f8684e7e832988060116b75e1c8503a (patch) | |
tree | 9475ea290e071a3469cbe1be03fb9b348ec5f6f1 /Userland/Libraries/LibTLS/Record.cpp | |
parent | b5f24c84e450d9bfc794a5c656f9bcf17faf6556 (diff) | |
download | serenity-2020176f0f8684e7e832988060116b75e1c8503a.zip |
LibTLS: Make the TLS connection options user-configurable
The user may now request specific cipher suites, the use of SNI, and
whether we should validate certificates (not that we're doing a good job
of that).
Diffstat (limited to 'Userland/Libraries/LibTLS/Record.cpp')
-rw-r--r-- | Userland/Libraries/LibTLS/Record.cpp | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibTLS/Record.cpp b/Userland/Libraries/LibTLS/Record.cpp index 3b0eefcf71..91e0349b8f 100644 --- a/Userland/Libraries/LibTLS/Record.cpp +++ b/Userland/Libraries/LibTLS/Record.cpp @@ -61,7 +61,7 @@ void TLSv12::update_packet(ByteBuffer& packet) if (packet[0] == (u8)MessageType::Handshake && packet.size() > header_size) { u8 handshake_type = packet[header_size]; if (handshake_type != HandshakeType::HelloRequest && handshake_type != HandshakeType::HelloVerifyRequest) { - update_hash(packet.bytes().slice(header_size, packet.size() - header_size)); + update_hash(packet.bytes(), header_size); } } if (m_context.cipher_spec_set && m_context.crypto.created) { @@ -190,9 +190,10 @@ void TLSv12::update_packet(ByteBuffer& packet) ++m_context.local_sequence_number; } -void TLSv12::update_hash(ReadonlyBytes message) +void TLSv12::update_hash(ReadonlyBytes message, size_t header_size) { - m_context.handshake_hash.update(message); + dbgln("Update hash with message of size {}", message.size()); + m_context.handshake_hash.update(message.slice(header_size)); } ByteBuffer TLSv12::hmac_message(const ReadonlyBytes& buf, const Optional<ReadonlyBytes> buf2, size_t mac_length, bool local) |