summaryrefslogtreecommitdiff
path: root/Libraries/LibTLS
diff options
context:
space:
mode:
Diffstat (limited to 'Libraries/LibTLS')
-rw-r--r--Libraries/LibTLS/Record.cpp10
-rw-r--r--Libraries/LibTLS/TLSv12.cpp2
2 files changed, 6 insertions, 6 deletions
diff --git a/Libraries/LibTLS/Record.cpp b/Libraries/LibTLS/Record.cpp
index ddd34379d5..ba9cb23134 100644
--- a/Libraries/LibTLS/Record.cpp
+++ b/Libraries/LibTLS/Record.cpp
@@ -92,7 +92,7 @@ void TLSv12::update_packet(ByteBuffer& packet)
buffer_position += packet.size() - header_size;
// get the appropricate HMAC value for the entire packet
- auto mac = hmac_message(packet.span(), {}, mac_size, true);
+ auto mac = hmac_message(packet, {}, mac_size, true);
// write the MAC
buffer.overwrite(buffer_position, mac.data(), mac.size());
@@ -114,8 +114,8 @@ void TLSv12::update_packet(ByteBuffer& packet)
ASSERT(length % block_size == 0);
// get a block to encrypt into
- auto view = ct.span().slice(header_size + iv_size, length);
- m_aes_local->encrypt(buffer.span(), view, iv.span());
+ auto view = ct.bytes().slice(header_size + iv_size, length);
+ m_aes_local->encrypt(buffer, view, iv);
// store the correct ciphertext length into the packet
u16 ct_length = (u16)ct.size() - header_size;
@@ -215,8 +215,8 @@ ssize_t TLSv12::handle_message(const ByteBuffer& buffer)
auto decrypted = m_aes_remote->create_aligned_buffer(length - iv_size);
auto iv = buffer.slice_view(header_size, iv_size);
- Bytes decrypted_span = decrypted.span();
- m_aes_remote->decrypt(buffer.span().slice(header_size + iv_size, length - iv_size), decrypted_span, iv.span());
+ Bytes decrypted_span = decrypted;
+ m_aes_remote->decrypt(buffer.bytes().slice(header_size + iv_size, length - iv_size), decrypted_span, iv);
length = decrypted_span.size();
diff --git a/Libraries/LibTLS/TLSv12.cpp b/Libraries/LibTLS/TLSv12.cpp
index 0579e23265..7d219bca6a 100644
--- a/Libraries/LibTLS/TLSv12.cpp
+++ b/Libraries/LibTLS/TLSv12.cpp
@@ -727,7 +727,7 @@ bool TLSv12::add_client_key(const ByteBuffer& certificate_pem_buffer, const Byte
if (certificate_pem_buffer.is_empty() || rsa_key.is_empty()) {
return true;
}
- auto decoded_certificate = decode_pem(certificate_pem_buffer.span(), 0);
+ auto decoded_certificate = decode_pem(certificate_pem_buffer, 0);
if (decoded_certificate.is_empty()) {
dbg() << "Certificate not PEM";
return false;