]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Minor fixes
authorHugo Landau <hlandau@openssl.org>
Thu, 21 Mar 2024 10:47:21 +0000 (10:47 +0000)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:35:22 +0000 (18:35 +1000)
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23334)

include/internal/quic_port.h
ssl/quic/quic_obj.c
ssl/quic/quic_obj_local.h

index 1f8997a1591df3e4e340a506e907aa0e396cc8ac..9c74390ab298ae950ab4beb8681bef99caabbb43 100644 (file)
@@ -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. */
index 8529ad70d7445b89216107a14fb0f89f14b00954..ffe6b1bcda1116bc0132afff61d9f8deb1801db1 100644 (file)
@@ -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;
 
index 55daf822151b565ee71cb5cb32fd454f8aa6ed8e..d0cfa4165b5e6e4fc05e870d3aa957ee4a4f3552 100644 (file)
@@ -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;
 }
 
 /*