summaryrefslogtreecommitdiffstats
path: root/src/include/ipxe/tls.h
diff options
context:
space:
mode:
authorMichael Brown2019-02-21 12:32:25 +0100
committerMichael Brown2019-02-21 12:32:25 +0100
commit272fe32529103dd39875a9fbed5cfdf1a059e294 (patch)
tree207872cd3a5c9159d55418b5e4bf31611f00a16c /src/include/ipxe/tls.h
parent[efi] Blacklist the Dell Ip4ConfigDxe driver (diff)
downloadipxe-272fe32529103dd39875a9fbed5cfdf1a059e294.tar.gz
ipxe-272fe32529103dd39875a9fbed5cfdf1a059e294.tar.xz
ipxe-272fe32529103dd39875a9fbed5cfdf1a059e294.zip
[tls] Support stateful session resumption
Record the session ID (if any) provided by the server and attempt to reuse it for any concurrent connections to the same server. If multiple connections are initiated concurrently (e.g. when using PeerDist) then defer sending the ClientHello for all but the first connection, to allow time for the first connection to potentially obtain a session ID (and thereby speed up the negotiation for all remaining connections). Signed-off-by: Michael Brown <mcb30@ipxe.org>
Diffstat (limited to 'src/include/ipxe/tls.h')
-rw-r--r--src/include/ipxe/tls.h31
1 files changed, 29 insertions, 2 deletions
diff --git a/src/include/ipxe/tls.h b/src/include/ipxe/tls.h
index b1e702e1..0375a722 100644
--- a/src/include/ipxe/tls.h
+++ b/src/include/ipxe/tls.h
@@ -242,13 +242,40 @@ struct md5_sha1_digest {
/** MD5+SHA1 digest size */
#define MD5_SHA1_DIGEST_SIZE sizeof ( struct md5_sha1_digest )
-/** A TLS connection */
-struct tls_connection {
+/** A TLS session */
+struct tls_session {
/** Reference counter */
struct refcnt refcnt;
+ /** List of sessions */
+ struct list_head list;
/** Server name */
const char *name;
+ /** Session ID */
+ uint8_t id[32];
+ /** Length of session ID */
+ size_t id_len;
+ /** Master secret */
+ uint8_t master_secret[48];
+
+ /** List of connections */
+ struct list_head conn;
+};
+
+/** A TLS connection */
+struct tls_connection {
+ /** Reference counter */
+ struct refcnt refcnt;
+
+ /** Session */
+ struct tls_session *session;
+ /** List of connections within the same session */
+ struct list_head list;
+ /** Session ID */
+ uint8_t session_id[32];
+ /** Length of session ID */
+ size_t session_id_len;
+
/** Plaintext stream */
struct interface plainstream;
/** Ciphertext stream */