mirror of
https://github.com/ipxe/ipxe
synced 2025-12-16 09:32:33 +03:00
[tls] Add support for Ephemeral Elliptic Curve Diffie-Hellman key exchange
Add support for the Ephemeral Elliptic Curve Diffie-Hellman (ECDHE) key exchange algorithm. Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
@@ -119,6 +119,10 @@ struct tls_header {
|
||||
#define TLS_MAX_FRAGMENT_LENGTH_2048 3
|
||||
#define TLS_MAX_FRAGMENT_LENGTH_4096 4
|
||||
|
||||
/* TLS named curve extension */
|
||||
#define TLS_NAMED_CURVE 10
|
||||
#define TLS_NAMED_CURVE_X25519 29
|
||||
|
||||
/* TLS signature algorithms extension */
|
||||
#define TLS_SIGNATURE_ALGORITHMS 13
|
||||
|
||||
@@ -205,6 +209,25 @@ struct tls_cipher_suite {
|
||||
#define __tls_cipher_suite( pref ) \
|
||||
__table_entry ( TLS_CIPHER_SUITES, pref )
|
||||
|
||||
/** TLS named curved type */
|
||||
#define TLS_NAMED_CURVE_TYPE 3
|
||||
|
||||
/** A TLS named curve */
|
||||
struct tls_named_curve {
|
||||
/** Elliptic curve */
|
||||
struct elliptic_curve *curve;
|
||||
/** Numeric code (in network-endian order) */
|
||||
uint16_t code;
|
||||
};
|
||||
|
||||
/** TLS named curve table */
|
||||
#define TLS_NAMED_CURVES \
|
||||
__table ( struct tls_named_curve, "tls_named_curves" )
|
||||
|
||||
/** Declare a TLS named curve */
|
||||
#define __tls_named_curve( pref ) \
|
||||
__table_entry ( TLS_NAMED_CURVES, pref )
|
||||
|
||||
/** A TLS cipher specification */
|
||||
struct tls_cipherspec {
|
||||
/** Cipher suite */
|
||||
@@ -425,6 +448,7 @@ struct tls_connection {
|
||||
|
||||
extern struct tls_key_exchange_algorithm tls_pubkey_exchange_algorithm;
|
||||
extern struct tls_key_exchange_algorithm tls_dhe_exchange_algorithm;
|
||||
extern struct tls_key_exchange_algorithm tls_ecdhe_exchange_algorithm;
|
||||
|
||||
extern int add_tls ( struct interface *xfer, const char *name,
|
||||
struct x509_root *root, struct private_key *key );
|
||||
|
||||
Reference in New Issue
Block a user