]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Minor updates
authorHugo Landau <hlandau@openssl.org>
Thu, 28 Mar 2024 08:13:55 +0000 (08:13 +0000)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:35:22 +0000 (18:35 +1000)
Reviewed-by: Neil Horman <nhorman@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/23487)

doc/designs/quic-design/server/quic-polling.md
ssl/quic/quic_obj_local.h
ssl/ssl_lib.c
ssl/t1_trce.c
test/radix/quic_bindings.c
test/radix/quic_ops.c

index a7757001a3c7cfab38f131cb8a4a2303766f9453..802fdf48d7b02123ed146cd90ccfc7a13e272b40 100644 (file)
@@ -408,7 +408,7 @@ issues with this design:
   This limitation is intrinsic to the design of `poll(2)` and poll-esque APIs.
   It is not necessarily a reason not to offer this rather simple API, as use of
   poll(2) and poll(2)-like APIs is widespread and users are likely to appreciate
-  an API which does not provide significant impedence discontinuities to
+  an API which does not provide significant impedance discontinuities to
   applications which use select/poll, even if those applications suffer impaired
   performance as a result.
 
@@ -1424,7 +1424,7 @@ socket handle and then closes it. What happens?**
 
 Since OSes in general do not provide a way to get notified of these closures it
 is not really possible to handle this automatically. It is essential that an
-application deregister the handle from the poll group first.
+application deregisters the handle from the poll group first.
 
 **Q. How does code using a poll method determine what poll descriptors that
 method supports?**
index d0cfa4165b5e6e4fc05e870d3aa957ee4a4f3552..fa5b33f2656cc5b60b4df6ec99ca4d6372e8009c 100644 (file)
@@ -30,7 +30,7 @@
  *
  * The QUIC_OBJ is a base type for QUIC APL objects which provides functionality
  * common to all QUIC objects and which supports having different APL objects
- * dynamically assume leader roles. It can therefore be seen as an extention of
+ * dynamically assume leader roles. It can therefore be seen as an extension of
  * the SSL base class and extends the SSL object for QUIC APL objects. This
  * avoids duplication of functionality for different types of QUIC object and
  * allows access to common responsibilities of different types of APL object
@@ -64,8 +64,8 @@
  *
  * This structure must come at the start of a QUIC object structure definition.
  *
- * ssl->type still determines the actual object type. An SSL object pointer s
- * can be safely cast to (QUIC_OBJ *) iff IS_QUIC(s) is true.
+ * ssl->type still determines the actual object type. An SSL object
+ * pointer s can be safely cast to (QUIC_OBJ *) iff IS_QUIC(s) is true.
  */
 struct quic_obj_st {
     /* SSL object common header. */
@@ -105,6 +105,11 @@ struct quic_obj_st {
     unsigned int            is_port_leader  : 1;
 };
 
+/*
+ * Core Functions and Inlines
+ * ==========================
+ */
+
 /*
  * Initialises a QUIC_OBJ structure with zero or more roles active. Returns 1
  * on success or 0 on failure.
@@ -217,6 +222,8 @@ ossl_quic_obj_get0_port_local(const QUIC_OBJ *obj)
 /*
  * Convenience Inlines
  * ===================
+ *
+ * These inlines are expressed in terms of the core functions and inlines above.
  */
 
 /* Get a pointer to the QUIC domain mutex. Always returns non-NULL. */
index 26ff825dbfeb5a83e6ab5597ab4903944f568ce9..d9351706e820dcbe93d4c3181fa626edd9ab1bb5 100644 (file)
@@ -7538,11 +7538,11 @@ SSL *SSL_get0_listener(SSL *s)
 {
 #ifndef OPENSSL_NO_QUIC
     if (!IS_QUIC(s))
-        return s;
+        return NULL;
 
     return ossl_quic_get0_listener(s);
 #else
-    return s;
+    return NULL;
 #endif
 }
 
index 51fe07e99950cb7369334755d0283bc9bf08e02d..0ffa5bf82ccc083e64fc1222c7428e17c60e59c2 100644 (file)
@@ -14,9 +14,7 @@
 /* Packet trace support for OpenSSL */
 #include "internal/nelem.h"
 #include "internal/ssl_unwrap.h"
-#include "internal/quic_predef.h"
 #include "internal/quic_trace.h"
-#include "quic/quic_local.h"
 
 typedef struct {
     int num;
index 03d8e48a8b11fd46c85c04d208c3dbf84ccc6b13..f2eb1474cf1f0c50b1a41fb2d5dbd74046ca76d8 100644 (file)
@@ -114,7 +114,11 @@ static RADIX_OBJ *RADIX_OBJ_new(const char *name, SSL *ssl)
     if (!TEST_ptr(obj = OPENSSL_zalloc(sizeof(*obj))))
        return NULL;
 
-    obj->name = OPENSSL_strdup(name);
+    if (!TEST_ptr(obj->name = OPENSSL_strdup(name))) {
+        OPENSSL_free(obj);
+        return NULL;
+    }
+
     obj->ssl  = ssl;
     return obj;
 }
index 0a60176590892ad52efc47062252b2c96c9d67b2..955a5cb83f22e54ae2c2ff21861525c51b76de95 100644 (file)
@@ -587,7 +587,7 @@ DEF_FUNC(hf_connect_wait)
         goto err;
 
     if (ret != 1) {
-        if (1 /* TODO */ && is_want(ssl, ret))
+        if (is_want(ssl, ret))
             F_SPIN_AGAIN();
 
         if (!TEST_int_eq(ret, 1))