summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorstelar7 <dudedbz@gmail.com>2023-04-14 00:17:37 +0200
committerSam Atkins <atkinssj@gmail.com>2023-04-14 12:32:04 +0100
commite5f81475e5181c34281635baa202966c2372b257 (patch)
tree302d602c17ff53f70ec9c599cb603a07d41c56ba
parenta4855aef17ab0c93409a195a20a0c8db8f1e3a5e (diff)
downloadserenity-e5f81475e5181c34281635baa202966c2372b257.zip
LibTLS: Move ECPointFormat to Extensions.h
Also add missing values from the IANA registry
-rw-r--r--Userland/Libraries/LibTLS/CipherSuite.h4
-rw-r--r--Userland/Libraries/LibTLS/Extensions.h10
-rw-r--r--Userland/Libraries/LibTLS/TLSv12.h2
3 files changed, 11 insertions, 5 deletions
diff --git a/Userland/Libraries/LibTLS/CipherSuite.h b/Userland/Libraries/LibTLS/CipherSuite.h
index 422ddc61c0..c4923dec95 100644
--- a/Userland/Libraries/LibTLS/CipherSuite.h
+++ b/Userland/Libraries/LibTLS/CipherSuite.h
@@ -189,8 +189,4 @@ constexpr size_t cipher_key_size(CipherAlgorithm algorithm)
}
}
-enum class ECPointFormat : u8 {
- Uncompressed = 0,
-};
-
}
diff --git a/Userland/Libraries/LibTLS/Extensions.h b/Userland/Libraries/LibTLS/Extensions.h
index 54cc5845d6..2dfb49ef33 100644
--- a/Userland/Libraries/LibTLS/Extensions.h
+++ b/Userland/Libraries/LibTLS/Extensions.h
@@ -247,6 +247,16 @@ enum class SupportedGroup : u16 {
__ENUM_SUPPORTED_GROUPS
};
+// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-9
+#define __ENUM_EC_POINT_FORMATS \
+ _ENUM_KEY_VALUE(UNCOMPRESSED, 0) \
+ _ENUM_KEY_VALUE(ANSIX962_COMPRESSED_PRIME, 1) \
+ _ENUM_KEY_VALUE(ANSIX962_COMPRESSED_CHAR2, 2)
+
+enum class ECPointFormat : u8 {
+ __ENUM_EC_POINT_FORMATS
+};
+
#undef _ENUM_KEY
#undef _ENUM_KEY_VALUE
diff --git a/Userland/Libraries/LibTLS/TLSv12.h b/Userland/Libraries/LibTLS/TLSv12.h
index 78498310e8..11aa39f589 100644
--- a/Userland/Libraries/LibTLS/TLSv12.h
+++ b/Userland/Libraries/LibTLS/TLSv12.h
@@ -215,7 +215,7 @@ struct Options {
SupportedGroup::X25519,
SupportedGroup::SECP256R1,
SupportedGroup::X448)
- OPTION_WITH_DEFAULTS(Vector<ECPointFormat>, supported_ec_point_formats, ECPointFormat::Uncompressed)
+ OPTION_WITH_DEFAULTS(Vector<ECPointFormat>, supported_ec_point_formats, ECPointFormat::UNCOMPRESSED)
OPTION_WITH_DEFAULTS(bool, use_sni, true)
OPTION_WITH_DEFAULTS(bool, use_compression, false)