mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 19:27:45 +00:00
LibTLS: Move ECCurveType to Extensions.h
Also add missing values from the IANA registry
This commit is contained in:
parent
0fea6e7f13
commit
6df3ffaf45
3 changed files with 11 additions and 5 deletions
|
@ -166,6 +166,16 @@ enum class NameType : u8 {
|
||||||
__ENUM_NAME_TYPES
|
__ENUM_NAME_TYPES
|
||||||
};
|
};
|
||||||
|
|
||||||
|
// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-10
|
||||||
|
#define __ENUM_EC_CURVE_TYPES \
|
||||||
|
_ENUM_KEY_VALUE(EXPLICIT_PRIME, 1) \
|
||||||
|
_ENUM_KEY_VALUE(EXPLICIT_CHAR2, 2) \
|
||||||
|
_ENUM_KEY_VALUE(NAMED_CURVE, 3)
|
||||||
|
|
||||||
|
enum class ECCurveType : u8 {
|
||||||
|
__ENUM_EC_CURVE_TYPES
|
||||||
|
};
|
||||||
|
|
||||||
#undef _ENUM_KEY
|
#undef _ENUM_KEY
|
||||||
#undef _ENUM_KEY_VALUE
|
#undef _ENUM_KEY_VALUE
|
||||||
|
|
||||||
|
|
|
@ -298,7 +298,7 @@ ssize_t TLSv12::handle_ecdhe_rsa_server_key_exchange(ReadonlyBytes buffer)
|
||||||
return (i8)Error::NeedMoreData;
|
return (i8)Error::NeedMoreData;
|
||||||
|
|
||||||
auto curve_type = buffer[3];
|
auto curve_type = buffer[3];
|
||||||
if (curve_type != (u8)ECCurveType::NamedCurve)
|
if (curve_type != (u8)ECCurveType::NAMED_CURVE)
|
||||||
return (i8)Error::NotUnderstood;
|
return (i8)Error::NotUnderstood;
|
||||||
|
|
||||||
auto curve = static_cast<NamedCurve>(AK::convert_between_host_and_network_endian(ByteReader::load16(buffer.offset_pointer(4))));
|
auto curve = static_cast<NamedCurve>(AK::convert_between_host_and_network_endian(ByteReader::load16(buffer.offset_pointer(4))));
|
||||||
|
|
|
@ -133,10 +133,6 @@ enum ClientVerificationStaus {
|
||||||
VerificationNeeded,
|
VerificationNeeded,
|
||||||
};
|
};
|
||||||
|
|
||||||
enum class ECCurveType : u8 {
|
|
||||||
NamedCurve = 3,
|
|
||||||
};
|
|
||||||
|
|
||||||
// Note for the 16 iv length instead of 8:
|
// Note for the 16 iv length instead of 8:
|
||||||
// 4 bytes of fixed IV, 8 random (nonce) bytes, 4 bytes for counter
|
// 4 bytes of fixed IV, 8 random (nonce) bytes, 4 bytes for counter
|
||||||
// GCM specifically asks us to transmit only the nonce, the counter is zero
|
// GCM specifically asks us to transmit only the nonce, the counter is zero
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue