1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 02:28:12 +00:00

LibTLS: Even more ByteBuffer -> Span conversion

This commit is contained in:
Andreas Kling 2020-12-19 16:23:52 +01:00
parent f82b0a78ef
commit e517505e35
8 changed files with 18 additions and 23 deletions

View file

@ -371,7 +371,7 @@ ssize_t TLSv12::handle_message(ReadonlyBytes buffer)
memcpy(temp_buf, buffer.offset_pointer(0), 3);
*(u16*)(temp_buf + 3) = AK::convert_between_host_and_network_endian(length);
auto hmac = hmac_message({ temp_buf, 5 }, decrypted_span.slice(0, length), mac_size);
auto message_mac = ByteBuffer::wrap(const_cast<u8*>(message_hmac), mac_size);
auto message_mac = ReadonlyBytes { message_hmac, mac_size };
if (hmac != message_mac) {
dbg() << "integrity check failed (mac length " << mac_size << ")";
dbg() << "mac received:";