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

LibTLS: Rename Version to ProtocolVersion

This matches the wording used in the TLS RFC
Also define GREASE values as specified in RFC8701
This commit is contained in:
stelar7 2023-04-13 23:53:22 +02:00 committed by Sam Atkins
parent 082e64e167
commit ca6b8bfe7f
5 changed files with 33 additions and 14 deletions

View file

@ -14,21 +14,14 @@
namespace TLS {
enum class Version : u16 {
V10 = 0x0301,
V11 = 0x0302,
V12 = 0x0303,
V13 = 0x0304
};
class PacketBuilder {
public:
PacketBuilder(ContentType type, u16 version, size_t size_hint = 0xfdf)
: PacketBuilder(type, (Version)version, size_hint)
: PacketBuilder(type, (ProtocolVersion)version, size_hint)
{
}
PacketBuilder(ContentType type, Version version, size_t size_hint = 0xfdf)
PacketBuilder(ContentType type, ProtocolVersion 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();