[tls] Poison initial resumption master secret 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>
diff --git a/src/net/tls.c b/src/net/tls.c index 9c2f4cd..907f407 100644 --- a/src/net/tls.c +++ b/src/net/tls.c
@@ -4268,6 +4268,11 @@ 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;