diff options
author | Michael Brown <mcb30@ipxe.org> | 2024-01-30 15:09:49 +0000 |
---|---|---|
committer | Michael Brown <mcb30@ipxe.org> | 2024-01-30 16:16:31 +0000 |
commit | b234226dbc4f348c7e4a5c61bdf7b0f8f0aef16c (patch) | |
tree | 8ce4a102d739c49850362f314ec0539fe9bde392 /src/include/ipxe | |
parent | 8e2469c861fd25ac4956ca6b3bc3ed4ab8d74308 (diff) | |
download | ipxe-b234226dbc4f348c7e4a5c61bdf7b0f8f0aef16c.zip ipxe-b234226dbc4f348c7e4a5c61bdf7b0f8f0aef16c.tar.gz ipxe-b234226dbc4f348c7e4a5c61bdf7b0f8f0aef16c.tar.bz2 |
[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>
Diffstat (limited to 'src/include/ipxe')
-rw-r--r-- | src/include/ipxe/tls.h | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/src/include/ipxe/tls.h b/src/include/ipxe/tls.h index 30bb1c4..5c218f8 100644 --- a/src/include/ipxe/tls.h +++ b/src/include/ipxe/tls.h @@ -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 ); |