]> git.ipfire.org Git - thirdparty/ipxe.git/commitdiff
[tls] Poison initial resumption master secret
authorMichael Brown <mcb30@ipxe.org>
Wed, 8 Jul 2026 11:02:51 +0000 (12:02 +0100)
committerMichael Brown <mcb30@ipxe.org>
Wed, 8 Jul 2026 11:05:05 +0000 (12:05 +0100)
There should be no circumstance that leads to a session being resumed
without having a valid session resumption secret that was stored by a
successfully established previous connection.

As an additional layer of defence in depth, poison the initial session
resumption master secret so that a predictable all-zero secret can
never be used accidentally in future.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
src/net/tls.c

index 9c2f4cdf69296c549f12145ee3f59538a4ed79f7..907f4071cfd84172dd1d38f7124f25b3675454a1 100644 (file)
@@ -4268,6 +4268,11 @@ static int tls_session ( struct tls_connection *tls, const char *name ) {
        INIT_LIST_HEAD ( &session->conn );
        list_add ( &session->list, &tls_sessions );
 
+       /* Poison resumption master secret */
+       tls_ephemeral_label ( tls, "res poison",
+                             session->resumption_master_secret,
+                             sizeof ( session->resumption_master_secret ) );
+
        /* Record session */
        tls->session = session;