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 <mcb30@ipxe.org>
/* 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 );