aboutsummaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/tls.h
diff options
context:
space:
mode:
authorMichael Brown <mcb30@ipxe.org>2022-10-11 13:54:34 +0100
committerMichael Brown <mcb30@ipxe.org>2022-10-11 14:37:12 +0100
commitea33ea33c0d77b853c39d7b0e8c54f1a6f56b6bc (patch)
treec36d42e2c31a03ffe03bb0a646a2c0e075082abf /src/include/ipxe/tls.h
parent80c45c5c71af76e4313c37528d29aa485b247073 (diff)
downloadipxe-ea33ea33c0d77b853c39d7b0e8c54f1a6f56b6bc.tar.gz
[tls] Add key exchange mechanism to definition of cipher suite
Allow for the key exchange mechanism to vary depending upon the selected cipher suite. Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/tls.h')
-rw-r--r--src/include/ipxe/tls.h19
1 files changed, 19 insertions, 0 deletions
diff --git a/src/include/ipxe/tls.h b/src/include/ipxe/tls.h
index 672cfbd7e..80cdd12fe 100644
--- a/src/include/ipxe/tls.h
+++ b/src/include/ipxe/tls.h
@@ -23,6 +23,8 @@ FILE_LICENCE ( GPL2_OR_LATER_OR_UBDL );
#include <ipxe/iobuf.h>
#include <ipxe/tables.h>
+struct tls_connection;
+
/** A TLS header */
struct tls_header {
/** Content type
@@ -143,8 +145,23 @@ enum tls_tx_pending {
TLS_TX_FINISHED = 0x0020,
};
+/** A TLS key exchange algorithm */
+struct tls_key_exchange_algorithm {
+ /** Algorithm name */
+ const char *name;
+ /**
+ * Transmit Client Key Exchange record
+ *
+ * @v tls TLS connection
+ * @ret rc Return status code
+ */
+ int ( * exchange ) ( struct tls_connection *tls );
+};
+
/** A TLS cipher suite */
struct tls_cipher_suite {
+ /** Key exchange algorithm */
+ struct tls_key_exchange_algorithm *exchange;
/** Public-key encryption algorithm */
struct pubkey_algorithm *pubkey;
/** Bulk encryption cipher algorithm */
@@ -385,6 +402,8 @@ struct tls_connection {
/** RX I/O buffer alignment */
#define TLS_RX_ALIGN 16
+extern struct tls_key_exchange_algorithm tls_pubkey_exchange_algorithm;
+
extern int add_tls ( struct interface *xfer, const char *name,
struct x509_root *root, struct private_key *key );