]> git.ipfire.org Git - thirdparty/ipxe.git/commit
[tls] Retain a reference in the key schedule to the bound identity
authorMichael Brown <mcb30@ipxe.org>
Wed, 8 Jul 2026 22:27:05 +0000 (23:27 +0100)
committerMichael Brown <mcb30@ipxe.org>
Thu, 9 Jul 2026 11:09:55 +0000 (12:09 +0100)
commit433a8f552f007255d3a0fa13aa7963e0281c9981
tree8ef1e61cf66cdfe3a76991651f7ed80aead928ef
parent6ba010eaada9c089c92804969f9181d88d7ccc7c
[tls] Retain a reference in the key schedule to the bound identity

Change the "bound" field from being a boolean flag to being a
reference to the server identity (i.e. the certificate) to which the
shared secret has been bound.

This reduces the chances for future bugs that could be caused by
potentially losing track of which identity has been bound, and also
provides a natural way to extend the field to be able to represent an
identity that has not yet been validated (as will be required for TLS
version 1.3 key exchange).

Add a check that the bound identity has been validated at the point of
sending our client Finished handshake.  We must defer sending the
client Finished until validation has completed, to prevent the server
from sending application traffic until we are ready to receive it, and
so this provides a natural point at which we know that the bound
identity must have been validated.

Since the validity check is now deferred until the point of sending
the client Finished, and since commit 6ba010e ("[tls] Reject incorrect
server names before completing validation") already ensures that the
certificate must have the correct name, there is no need to extract
and store the certificate's public key separately after validation has
completed.

We also update the session key (and related parameters) only if the
bound identity has been validated.  This creates an invariant that if
a server certificate is stored in the session then it is always
guaranteed to be valid, which simplifies reasoning about session
resumption flows.

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