summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-03-21 10:47:21 +0000
committerHugo Landau <hlandau@openssl.org>2024-04-19 09:31:06 +0100
commite46533f924b203cda4afb7258b0d4a263166a5fb (patch)
tree51139fd922567cda84938cc0c34e1948a544faad
parentc4d3a0cca2a9704425d0280d28b51826fd97e125 (diff)
Minor fixes
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23334)
-rw-r--r--include/internal/quic_port.h2
-rw-r--r--ssl/quic/quic_obj.c2
-rw-r--r--ssl/quic/quic_obj_local.h7
3 files changed, 6 insertions, 5 deletions
diff --git a/include/internal/quic_port.h b/include/internal/quic_port.h
index 1f8997a159..9c74390ab2 100644
--- a/include/internal/quic_port.h
+++ b/include/internal/quic_port.h
@@ -138,7 +138,7 @@ void ossl_quic_port_subtick(QUIC_PORT *port, QUIC_TICK_RESULT *r,
/* Returns the number of queued incoming channels. */
size_t ossl_quic_port_get_num_incoming_channels(const QUIC_PORT *port);
-/* Returns 1 if incoming connections should currently be allowed. */
+/* Sets if incoming connections should currently be allowed. */
void ossl_quic_port_set_allow_incoming(QUIC_PORT *port, int allow_incoming);
/* Returns 1 if we are using addressed mode on the read side. */
diff --git a/ssl/quic/quic_obj.c b/ssl/quic/quic_obj.c
index 8529ad70d7..ffe6b1bcda 100644
--- a/ssl/quic/quic_obj.c
+++ b/ssl/quic/quic_obj.c
@@ -23,7 +23,7 @@ int ossl_quic_obj_init(QUIC_OBJ *obj,
int is_event_leader = (engine != NULL);
int is_port_leader = (port != NULL);
- if (!ossl_assert(!obj->init_done && obj != NULL && SSL_TYPE_IS_QUIC(type)
+ if (!ossl_assert(obj != NULL && !obj->init_done && SSL_TYPE_IS_QUIC(type)
&& (parent_obj == NULL || IS_QUIC(parent_obj))))
return 0;
diff --git a/ssl/quic/quic_obj_local.h b/ssl/quic/quic_obj_local.h
index 55daf82215..d0cfa4165b 100644
--- a/ssl/quic/quic_obj_local.h
+++ b/ssl/quic/quic_obj_local.h
@@ -148,13 +148,14 @@ SSL_CONNECTION *ossl_quic_obj_get0_handshake_layer(QUIC_OBJ *obj);
static ossl_inline ossl_unused SSL *
ossl_quic_obj_get0_ssl(QUIC_OBJ *obj)
{
- assert(obj->init_done);
-
/*
* ->ssl is guaranteed to have an offset of 0 but the NULL check here makes
* ubsan happy.
*/
- return obj != NULL ? &obj->ssl : NULL;
+ if (!ossl_assert(obj != NULL))
+ return NULL;
+
+ return &obj->ssl;
}
/*