#include <openssl/ssl.h>
#include <openssl/params.h>
#include "internal/nelem.h"
+#include "internal/tlsgroups.h"
#include "prov/providercommon.h"
typedef struct tls_group_constants_st {
} TLS_GROUP_CONSTANTS;
static const TLS_GROUP_CONSTANTS group_list[35] = {
- { /* sect163k1 */ 0x0001, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect163r1 */ 0x0002, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect163r2 */ 0x0003, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect193r1 */ 0x0004, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect193r2 */ 0x0005, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect233k1 */ 0x0006, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect233r1 */ 0x0007, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect239k1 */ 0x0008, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect283k1 */ 0x0009, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect283r1 */ 0x000A, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect409k1 */ 0x000B, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect409r1 */ 0x000C, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect571k1 */ 0x000D, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* sect571r1 */ 0x000E, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp160k1 */ 0x000F, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp160r1 */ 0x0010, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp160r2 */ 0x0011, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp192k1 */ 0x0012, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp192r1 */ 0x0013, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp224k1 */ 0x0014, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp224r1 */ 0x0015, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp256k1 */ 0x0016, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp256r1 */ 0x0017, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp384r1 */ 0x0018, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* secp521r1 */ 0x0019, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* brainpoolP256r1 */ 0x001A, 128, TLS1_VERSION, TLS1_2_VERSION, DTLS1_VERSION, DTLS1_2_VERSION },
- { /* brainpoolP384r1 */ 0x001B, 192, TLS1_VERSION, TLS1_2_VERSION, DTLS1_VERSION, DTLS1_2_VERSION },
- { /* brainpoolP512r1 */ 0x001C, 256, TLS1_VERSION, TLS1_2_VERSION, DTLS1_VERSION, DTLS1_2_VERSION },
- { /* x25519 */ 0x001D, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
- { /* x448 */ 0x001E, 224, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect163k1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect163r1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect163r2, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect193r1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect193r2, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect233k1, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect233r1, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect239k1, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect283k1, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect283r1, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect409k1, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect409r1, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect571k1, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_sect571r1, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp160k1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp160r1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp160r2, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp192k1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp192r1, 80, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp224k1, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp224r1, 112, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp256k1, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp256r1, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp384r1, 192, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_secp521r1, 256, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_brainpoolP256r1, 128, TLS1_VERSION, TLS1_2_VERSION,
+ DTLS1_VERSION, DTLS1_2_VERSION },
+ { OSSL_TLS_GROUP_ID_brainpoolP384r1, 192, TLS1_VERSION, TLS1_2_VERSION,
+ DTLS1_VERSION, DTLS1_2_VERSION },
+ { OSSL_TLS_GROUP_ID_brainpoolP512r1, 256, TLS1_VERSION, TLS1_2_VERSION,
+ DTLS1_VERSION, DTLS1_2_VERSION },
+ { OSSL_TLS_GROUP_ID_x25519, 128, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
+ { OSSL_TLS_GROUP_ID_x448, 224, TLS1_VERSION, 0, DTLS1_VERSION, 0 },
/* Security bit values as given by BN_security_bits() */
- { /* ffdhe2048 */ 0x0100, 112, TLS1_3_VERSION, 0, -1, -1 },
- { /* ffdhe3072 */ 0x0101, 128, TLS1_3_VERSION, 0, -1, -1 },
- { /* ffdhe4096 */ 0x0102, 128, TLS1_3_VERSION, 0, -1, -1 },
- { /* ffdhe6144 */ 0x0103, 128, TLS1_3_VERSION, 0, -1, -1 },
- { /* ffdhe8192 */ 0x0104, 192, TLS1_3_VERSION, 0, -1, -1 },
+ { OSSL_TLS_GROUP_ID_ffdhe2048, 112, TLS1_3_VERSION, 0, -1, -1 },
+ { OSSL_TLS_GROUP_ID_ffdhe3072, 128, TLS1_3_VERSION, 0, -1, -1 },
+ { OSSL_TLS_GROUP_ID_ffdhe4096, 128, TLS1_3_VERSION, 0, -1, -1 },
+ { OSSL_TLS_GROUP_ID_ffdhe6144, 128, TLS1_3_VERSION, 0, -1, -1 },
+ { OSSL_TLS_GROUP_ID_ffdhe8192, 192, TLS1_3_VERSION, 0, -1, -1 },
};
#define TLS_GROUP_ENTRY(tlsname, realname, algorithm, idx) \
#include <openssl/provider.h>
#include "internal/nelem.h"
#include "internal/evp.h"
+#include "internal/tlsgroups.h"
#include "ssl_local.h"
#include <openssl/ct.h>
int nid;
uint16_t group_id;
} nid_to_group[] = {
- {NID_sect163k1, 0x0001},
- {NID_sect163r1, 0x0002},
- {NID_sect163r2, 0x0003},
- {NID_sect193r1, 0x0004},
- {NID_sect193r2, 0x0005},
- {NID_sect233k1, 0x0006},
- {NID_sect233r1, 0x0007},
- {NID_sect239k1, 0x0008},
- {NID_sect283k1, 0x0009},
- {NID_sect283r1, 0x000A},
- {NID_sect409k1, 0x000B},
- {NID_sect409r1, 0x000C},
- {NID_sect571k1, 0x000D},
- {NID_sect571r1, 0x000E},
- {NID_secp160k1, 0x000F},
- {NID_secp160r1, 0x0010},
- {NID_secp160r2, 0x0011},
- {NID_secp192k1, 0x0012},
- {NID_X9_62_prime192v1, 0x0013},
- {NID_secp224k1, 0x0014},
- {NID_secp224r1, 0x0015},
- {NID_secp256k1, 0x0016},
- {NID_X9_62_prime256v1, 0x0017},
- {NID_secp384r1, 0x0018},
- {NID_secp521r1, 0x0019},
- {NID_brainpoolP256r1, 0x001A},
- {NID_brainpoolP384r1, 0x001B},
- {NID_brainpoolP512r1, 0x001C},
- {EVP_PKEY_X25519, 0x001D},
- {EVP_PKEY_X448, 0x001E},
+ {NID_sect163k1, OSSL_TLS_GROUP_ID_sect163k1},
+ {NID_sect163r1, OSSL_TLS_GROUP_ID_sect163r1},
+ {NID_sect163r2, OSSL_TLS_GROUP_ID_sect163r2},
+ {NID_sect193r1, OSSL_TLS_GROUP_ID_sect193r1},
+ {NID_sect193r2, OSSL_TLS_GROUP_ID_sect193r2},
+ {NID_sect233k1, OSSL_TLS_GROUP_ID_sect233k1},
+ {NID_sect233r1, OSSL_TLS_GROUP_ID_sect233r1},
+ {NID_sect239k1, OSSL_TLS_GROUP_ID_sect239k1},
+ {NID_sect283k1, OSSL_TLS_GROUP_ID_sect283k1},
+ {NID_sect283r1, OSSL_TLS_GROUP_ID_sect283r1},
+ {NID_sect409k1, OSSL_TLS_GROUP_ID_sect409k1},
+ {NID_sect409r1, OSSL_TLS_GROUP_ID_sect409r1},
+ {NID_sect571k1, OSSL_TLS_GROUP_ID_sect571k1},
+ {NID_sect571r1, OSSL_TLS_GROUP_ID_sect571r1},
+ {NID_secp160k1, OSSL_TLS_GROUP_ID_secp160k1},
+ {NID_secp160r1, OSSL_TLS_GROUP_ID_secp160r1},
+ {NID_secp160r2, OSSL_TLS_GROUP_ID_secp160r2},
+ {NID_secp192k1, OSSL_TLS_GROUP_ID_secp192k1},
+ {NID_X9_62_prime192v1, OSSL_TLS_GROUP_ID_secp192r1},
+ {NID_secp224k1, OSSL_TLS_GROUP_ID_secp224k1},
+ {NID_secp224r1, OSSL_TLS_GROUP_ID_secp224r1},
+ {NID_secp256k1, OSSL_TLS_GROUP_ID_secp256k1},
+ {NID_X9_62_prime256v1, OSSL_TLS_GROUP_ID_secp256r1},
+ {NID_secp384r1, OSSL_TLS_GROUP_ID_secp384r1},
+ {NID_secp521r1, OSSL_TLS_GROUP_ID_secp521r1},
+ {NID_brainpoolP256r1, OSSL_TLS_GROUP_ID_brainpoolP256r1},
+ {NID_brainpoolP384r1, OSSL_TLS_GROUP_ID_brainpoolP384r1},
+ {NID_brainpoolP512r1, OSSL_TLS_GROUP_ID_brainpoolP512r1},
+ {EVP_PKEY_X25519, OSSL_TLS_GROUP_ID_x25519},
+ {EVP_PKEY_X448, OSSL_TLS_GROUP_ID_x448},
{NID_id_tc26_gost_3410_2012_256_paramSetA, 0x0022},
{NID_id_tc26_gost_3410_2012_256_paramSetB, 0x0023},
{NID_id_tc26_gost_3410_2012_256_paramSetC, 0x0024},
{NID_id_tc26_gost_3410_2012_512_paramSetA, 0x0026},
{NID_id_tc26_gost_3410_2012_512_paramSetB, 0x0027},
{NID_id_tc26_gost_3410_2012_512_paramSetC, 0x0028},
- {NID_ffdhe2048, 0x0100},
- {NID_ffdhe3072, 0x0101},
- {NID_ffdhe4096, 0x0102},
- {NID_ffdhe6144, 0x0103},
- {NID_ffdhe8192, 0x0104}
+ {NID_ffdhe2048, OSSL_TLS_GROUP_ID_ffdhe2048},
+ {NID_ffdhe3072, OSSL_TLS_GROUP_ID_ffdhe3072},
+ {NID_ffdhe4096, OSSL_TLS_GROUP_ID_ffdhe4096},
+ {NID_ffdhe6144, OSSL_TLS_GROUP_ID_ffdhe6144},
+ {NID_ffdhe8192, OSSL_TLS_GROUP_ID_ffdhe8192}
};
#endif