1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 23:37:36 +00:00

LibTLS: Rename MessageType to ContentType

This matches the wording used in the TLS RFC
This commit is contained in:
stelar7 2023-04-13 23:43:11 +02:00 committed by Sam Atkins
parent 1cfc630d13
commit 082e64e167
6 changed files with 52 additions and 24 deletions

View file

@ -10,16 +10,10 @@
#include <AK/ByteReader.h>
#include <AK/Endian.h>
#include <AK/Types.h>
#include <LibTLS/Extensions.h>
namespace TLS {
enum class MessageType : u8 {
ChangeCipher = 0x14,
Alert = 0x15,
Handshake = 0x16,
ApplicationData = 0x17,
};
enum class Version : u16 {
V10 = 0x0301,
V11 = 0x0302,
@ -29,12 +23,12 @@ enum class Version : u16 {
class PacketBuilder {
public:
PacketBuilder(MessageType type, u16 version, size_t size_hint = 0xfdf)
PacketBuilder(ContentType type, u16 version, size_t size_hint = 0xfdf)
: PacketBuilder(type, (Version)version, size_hint)
{
}
PacketBuilder(MessageType type, Version version, size_t size_hint = 0xfdf)
PacketBuilder(ContentType type, Version version, size_t size_hint = 0xfdf)
{
// FIXME: Handle possible OOM situation.
m_packet_data = ByteBuffer::create_uninitialized(size_hint + 16).release_value_but_fixme_should_propagate_errors();