[tls] Remove redundant null pointer check

The recorded key exchange group is selected at initialisation and can
never be set to NULL, in the same way that the cipher suite can never
be set to NULL (and is therefore not checked at the points of use).

Remove the redundant null pointer check, since it simply serves to
confuse readers of the code.

Signed-off-by: Michael Brown <mcb30@ipxe.org>
This commit is contained in:
Michael Brown
2026-09-22 10:15:01 +01:00
parent 1037cf358f
commit 2b6bd7660b
-8
View File
@@ -2171,13 +2171,6 @@ static int tls_send_client_key_exchange ( struct tls_connection *tls ) {
struct io_buffer *iobuf;
int rc;
/* Fail if we have not selected a named group */
if ( ! group ) {
DBGC ( tls, "TLS %p has no key exchange group\n", tls );
rc = -ENOENT_KEY_EXCHANGE;
goto err_group;
}
/* Encrypt (and implicitly bind) shared secret, if applicable */
if ( is_key_transport ( exchange ) ) {
if ( ( rc = tls_key_encrypt ( tls, group, &builder ) ) != 0 )
@@ -2230,7 +2223,6 @@ static int tls_send_client_key_exchange ( struct tls_connection *tls ) {
err_alloc:
err_size:
err_encrypt:
err_group:
free ( builder.data );
return rc;
}