From: Michael Brown Date: Wed, 8 Jul 2026 10:14:50 +0000 (+0100) Subject: [tls] Poison initial key derivation function master secret X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=792849763633f62ff9cbeec4ea22939b53d1c2fa;p=thirdparty%2Fipxe.git [tls] Poison initial key derivation function master secret A freshly initialised key derivation function master secret has the "keyed" flag clear and so cannot accidentally be used to establish a full TLS connection. As an additional layer of defence in depth, poison the initial key derivation master secret so that a predictable all-zero secret can never be used accidentally in future. Signed-off-by: Michael Brown --- diff --git a/src/net/tls.c b/src/net/tls.c index f0cad9ff0..9c2f4cdf6 100644 --- a/src/net/tls.c +++ b/src/net/tls.c @@ -549,6 +549,9 @@ static int tls_set_digest ( struct tls_connection *tls, /* Initialise handshake context */ digest_init ( digest, key->handshake ); + /* Poison key derivation function master secret */ + tls_ephemeral_label ( tls, "kdf poison", key->kdf, kdfsize ); + /* Sanity checks */ assert ( ! key->keyed ); assert ( ! key->bound );