mirror of
https://github.com/ipxe/ipxe
synced 2026-10-07 15:05:42 +03:00
[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:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user