mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 12:37:44 +00:00
LibTLS: Move SignatureAlgorithm to Extensions.h
Also add missing values from the IANA registry
This commit is contained in:
parent
e5f81475e5
commit
fba7695dcc
2 changed files with 17 additions and 9 deletions
|
@ -7,6 +7,7 @@
|
||||||
#pragma once
|
#pragma once
|
||||||
|
|
||||||
#include <AK/Types.h>
|
#include <AK/Types.h>
|
||||||
|
#include <LibTLS/Extensions.h>
|
||||||
|
|
||||||
namespace TLS {
|
namespace TLS {
|
||||||
|
|
||||||
|
@ -105,14 +106,6 @@ enum class HashAlgorithm : u8 {
|
||||||
SHA512 = 6,
|
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
|
// Defined in RFC 5246 section 7.4.1.4.1
|
||||||
struct SignatureAndHashAlgorithm {
|
struct SignatureAndHashAlgorithm {
|
||||||
HashAlgorithm hash;
|
HashAlgorithm hash;
|
||||||
|
@ -158,7 +151,7 @@ constexpr SignatureAlgorithm signature_for_key_exchange_algorithm(KeyExchangeAlg
|
||||||
case KeyExchangeAlgorithm::DH_anon:
|
case KeyExchangeAlgorithm::DH_anon:
|
||||||
case KeyExchangeAlgorithm::ECDH_anon:
|
case KeyExchangeAlgorithm::ECDH_anon:
|
||||||
default:
|
default:
|
||||||
return SignatureAlgorithm::Anonymous;
|
return SignatureAlgorithm::ANONYMOUS;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -257,6 +257,21 @@ enum class ECPointFormat : u8 {
|
||||||
__ENUM_EC_POINT_FORMATS
|
__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
|
||||||
#undef _ENUM_KEY_VALUE
|
#undef _ENUM_KEY_VALUE
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue