LibTLS: Move SignatureAlgorithm to Extensions.h
Also add missing values from the IANA registry
This commit is contained in:
parent
e5f81475e5
commit
fba7695dcc
Notes:
sideshowbarker
2024-07-17 07:14:09 +09:00
Author: https://github.com/stelar7 Commit: https://github.com/SerenityOS/serenity/commit/fba7695dcc Pull-request: https://github.com/SerenityOS/serenity/pull/18356 Reviewed-by: https://github.com/alimpfard ✅
2 changed files with 17 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
|||
#pragma once
|
||||
|
||||
#include <AK/Types.h>
|
||||
#include <LibTLS/Extensions.h>
|
||||
|
||||
namespace TLS {
|
||||
|
||||
|
@ -105,14 +106,6 @@ enum class HashAlgorithm : u8 {
|
|||
SHA512 = 6,
|
||||
};
|
||||
|
||||
// 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;
|
||||
|
@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -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
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue