diff options
author | stelar7 <dudedbz@gmail.com> | 2023-04-14 00:20:19 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-04-14 12:32:04 +0100 |
commit | da8edece295ab9bc762f3aecf2f874cb7ba72857 (patch) | |
tree | 7b2b10888839675dd1c2d6546dd331ec67d6c4fd /Userland/Libraries | |
parent | fba7695dccdc7df8f0f6994ca8f67ac9c5d3b335 (diff) | |
download | serenity-da8edece295ab9bc762f3aecf2f874cb7ba72857.zip |
LibTLS: Move HashAlgorithm to Extensions.h
Also add missing values from the IANA registry
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibTLS/CipherSuite.h | 11 | ||||
-rw-r--r-- | Userland/Libraries/LibTLS/Extensions.h | 15 |
2 files changed, 15 insertions, 11 deletions
diff --git a/Userland/Libraries/LibTLS/CipherSuite.h b/Userland/Libraries/LibTLS/CipherSuite.h index 1348b15e8b..ee60b9f69f 100644 --- a/Userland/Libraries/LibTLS/CipherSuite.h +++ b/Userland/Libraries/LibTLS/CipherSuite.h @@ -96,17 +96,6 @@ enum class CipherSuite { }; // Defined in RFC 5246 section 7.4.1.4.1 -enum class HashAlgorithm : u8 { - None = 0, - MD5 = 1, - SHA1 = 2, - SHA224 = 3, - SHA256 = 4, - SHA384 = 5, - SHA512 = 6, -}; - -// Defined in RFC 5246 section 7.4.1.4.1 struct SignatureAndHashAlgorithm { HashAlgorithm hash; SignatureAlgorithm signature; diff --git a/Userland/Libraries/LibTLS/Extensions.h b/Userland/Libraries/LibTLS/Extensions.h index 0a7ee03bc3..9c3a0f460a 100644 --- a/Userland/Libraries/LibTLS/Extensions.h +++ b/Userland/Libraries/LibTLS/Extensions.h @@ -272,6 +272,21 @@ enum class SignatureAlgorithm : u8 { __ENUM_SIGNATURE_ALGORITHM }; +// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-18 +#define __ENUM_HASH_ALGORITHM \ + _ENUM_KEY_VALUE(NONE, 0) \ + _ENUM_KEY_VALUE(MD5, 1) \ + _ENUM_KEY_VALUE(SHA1, 2) \ + _ENUM_KEY_VALUE(SHA224, 3) \ + _ENUM_KEY_VALUE(SHA256, 4) \ + _ENUM_KEY_VALUE(SHA384, 5) \ + _ENUM_KEY_VALUE(SHA512, 6) \ + _ENUM_KEY_VALUE(INTRINSIC, 8) + +enum class HashAlgorithm : u8 { + __ENUM_HASH_ALGORITHM +}; + #undef _ENUM_KEY #undef _ENUM_KEY_VALUE |