diff options
author | stelar7 <dudedbz@gmail.com> | 2023-04-14 00:19:20 +0200 |
---|---|---|
committer | Sam Atkins <atkinssj@gmail.com> | 2023-04-14 12:32:04 +0100 |
commit | fba7695dccdc7df8f0f6994ca8f67ac9c5d3b335 (patch) | |
tree | d97c1cf69a3bae651b3f3fa3697c3b63fee1d702 /Userland | |
parent | e5f81475e5181c34281635baa202966c2372b257 (diff) | |
download | serenity-fba7695dccdc7df8f0f6994ca8f67ac9c5d3b335.zip |
LibTLS: Move SignatureAlgorithm to Extensions.h
Also add missing values from the IANA registry
Diffstat (limited to 'Userland')
-rw-r--r-- | Userland/Libraries/LibTLS/CipherSuite.h | 11 | ||||
-rw-r--r-- | Userland/Libraries/LibTLS/Extensions.h | 15 |
2 files changed, 17 insertions, 9 deletions
diff --git a/Userland/Libraries/LibTLS/CipherSuite.h b/Userland/Libraries/LibTLS/CipherSuite.h index c4923dec95..1348b15e8b 100644 --- a/Userland/Libraries/LibTLS/CipherSuite.h +++ b/Userland/Libraries/LibTLS/CipherSuite.h @@ -7,6 +7,7 @@ #pragma once #include <AK/Types.h> +#include <LibTLS/Extensions.h> namespace TLS { @@ -106,14 +107,6 @@ enum class HashAlgorithm : u8 { }; // Defined in RFC 5246 section 7.4.1.4.1 -enum class SignatureAlgorithm : u8 { - Anonymous = 0, - RSA = 1, - DSA = 2, - ECDSA = 3, -}; - -// Defined in RFC 5246 section 7.4.1.4.1 struct SignatureAndHashAlgorithm { HashAlgorithm hash; SignatureAlgorithm signature; @@ -158,7 +151,7 @@ constexpr SignatureAlgorithm signature_for_key_exchange_algorithm(KeyExchangeAlg case KeyExchangeAlgorithm::DH_anon: case KeyExchangeAlgorithm::ECDH_anon: default: - return SignatureAlgorithm::Anonymous; + return SignatureAlgorithm::ANONYMOUS; } } diff --git a/Userland/Libraries/LibTLS/Extensions.h b/Userland/Libraries/LibTLS/Extensions.h index 2dfb49ef33..0a7ee03bc3 100644 --- a/Userland/Libraries/LibTLS/Extensions.h +++ b/Userland/Libraries/LibTLS/Extensions.h @@ -257,6 +257,21 @@ enum class ECPointFormat : u8 { __ENUM_EC_POINT_FORMATS }; +// https://www.iana.org/assignments/tls-parameters/tls-parameters.xhtml#tls-parameters-16 +#define __ENUM_SIGNATURE_ALGORITHM \ + _ENUM_KEY_VALUE(ANONYMOUS, 0) \ + _ENUM_KEY_VALUE(RSA, 1) \ + _ENUM_KEY_VALUE(DSA, 2) \ + _ENUM_KEY_VALUE(ECDSA, 3) \ + _ENUM_KEY_VALUE(ED25519, 7) \ + _ENUM_KEY_VALUE(ED448, 8) \ + _ENUM_KEY_VALUE(GOSTR34102012_256, 64) \ + _ENUM_KEY_VALUE(GOSTR34102012_512, 65) + +enum class SignatureAlgorithm : u8 { + __ENUM_SIGNATURE_ALGORITHM +}; + #undef _ENUM_KEY #undef _ENUM_KEY_VALUE |