]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
rename new_pending_ssl to new_pending_conn
authorNeil Horman <nhorman@openssl.org>
Fri, 10 Jan 2025 17:20:40 +0000 (12:20 -0500)
committerNeil Horman <nhorman@openssl.org>
Thu, 23 Jan 2025 16:50:42 +0000 (11:50 -0500)
Make it clear its only announcing connections, not streams

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Saša Nedvědický <sashan@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/26361)

doc/build.info
doc/man3/SSL_CTX_set_new_pending_conn_cb.pod [new file with mode: 0644]
doc/man3/SSL_CTX_set_new_pending_ssl_cb.pod [deleted file]
include/openssl/ssl.h.in
ssl/quic/quic_port.c
ssl/ssl_lib.c
ssl/ssl_local.h
test/radix/quic_ops.c
util/other.syms

index 949bda1734f8e085c482aba342b1c4802201d1f9..52a9580a7a3eec267550025ab26559b158c73948 100644 (file)
@@ -2363,10 +2363,10 @@ DEPEND[html/man3/SSL_CTX_set_msg_callback.html]=man3/SSL_CTX_set_msg_callback.po
 GENERATE[html/man3/SSL_CTX_set_msg_callback.html]=man3/SSL_CTX_set_msg_callback.pod
 DEPEND[man/man3/SSL_CTX_set_msg_callback.3]=man3/SSL_CTX_set_msg_callback.pod
 GENERATE[man/man3/SSL_CTX_set_msg_callback.3]=man3/SSL_CTX_set_msg_callback.pod
-DEPEND[html/man3/SSL_CTX_set_new_pending_ssl_cb.html]=man3/SSL_CTX_set_new_pending_ssl_cb.pod
-GENERATE[html/man3/SSL_CTX_set_new_pending_ssl_cb.html]=man3/SSL_CTX_set_new_pending_ssl_cb.pod
-DEPEND[man/man3/SSL_CTX_set_new_pending_ssl_cb.3]=man3/SSL_CTX_set_new_pending_ssl_cb.pod
-GENERATE[man/man3/SSL_CTX_set_new_pending_ssl_cb.3]=man3/SSL_CTX_set_new_pending_ssl_cb.pod
+DEPEND[html/man3/SSL_CTX_set_new_pending_conn_cb.html]=man3/SSL_CTX_set_new_pending_conn_cb.pod
+GENERATE[html/man3/SSL_CTX_set_new_pending_conn_cb.html]=man3/SSL_CTX_set_new_pending_conn_cb.pod
+DEPEND[man/man3/SSL_CTX_set_new_pending_conn_cb.3]=man3/SSL_CTX_set_new_pending_conn_cb.pod
+GENERATE[man/man3/SSL_CTX_set_new_pending_conn_cb.3]=man3/SSL_CTX_set_new_pending_conn_cb.pod
 DEPEND[html/man3/SSL_CTX_set_num_tickets.html]=man3/SSL_CTX_set_num_tickets.pod
 GENERATE[html/man3/SSL_CTX_set_num_tickets.html]=man3/SSL_CTX_set_num_tickets.pod
 DEPEND[man/man3/SSL_CTX_set_num_tickets.3]=man3/SSL_CTX_set_num_tickets.pod
@@ -3614,7 +3614,7 @@ html/man3/SSL_CTX_set_max_cert_list.html \
 html/man3/SSL_CTX_set_min_proto_version.html \
 html/man3/SSL_CTX_set_mode.html \
 html/man3/SSL_CTX_set_msg_callback.html \
-html/man3/SSL_CTX_set_new_pending_ssl_cb.html \
+html/man3/SSL_CTX_set_new_pending_conn_cb.html \
 html/man3/SSL_CTX_set_num_tickets.html \
 html/man3/SSL_CTX_set_options.html \
 html/man3/SSL_CTX_set_psk_client_callback.html \
@@ -4282,7 +4282,7 @@ man/man3/SSL_CTX_set_max_cert_list.3 \
 man/man3/SSL_CTX_set_min_proto_version.3 \
 man/man3/SSL_CTX_set_mode.3 \
 man/man3/SSL_CTX_set_msg_callback.3 \
-man/man3/SSL_CTX_set_new_pending_ssl_cb.3 \
+man/man3/SSL_CTX_set_new_pending_conn_cb.3 \
 man/man3/SSL_CTX_set_num_tickets.3 \
 man/man3/SSL_CTX_set_options.3 \
 man/man3/SSL_CTX_set_psk_client_callback.3 \
diff --git a/doc/man3/SSL_CTX_set_new_pending_conn_cb.pod b/doc/man3/SSL_CTX_set_new_pending_conn_cb.pod
new file mode 100644 (file)
index 0000000..a50b302
--- /dev/null
@@ -0,0 +1,50 @@
+=pod
+
+=head1 NAME
+
+SSL_CTX_set_new_pending_conn_cb, SSL_set_new_pending_conn_cb_fn - callback function to report creation of QUIC connection SSL objects 
+
+=head1 SYNOPSIS
+
+ typedef int (*SSL_set_new_pending_conn_cb_fn)(SSL_CTX *c, SSL *new_ssl,
+                                               void *arg);
+ void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c,
+                                     SSL_set_new_pending_conn_cb_fn *f,
+                                     void *arg);
+
+=head1 DESCRIPTION
+
+SSL_CTX_set_new_pending_conn_cb() sets the new_pending_conn callback function and
+associated application data argument I<arg>.  When using the QUIC transport, TLS
+handshake processing may occur independently from the thread which accepts the
+connection that the handshake is establishing.  As such, B<SSL> objects
+representing the connection may be allocated and initialized prior to a call to
+SSL_accept_connection().  This registered callback may be used to decorate the 
+preallocated B<SSL> object or create other associations with its parent
+B<SSL> prior to a call to SSL_accept_connection().
+
+=head1 RETURN VALUES
+
+SSL_CTX_set_new_pending_conn_cb() returns no value.
+
+SSL_set_new_pending_conn_cb_fn() returns an integer value.  A return value of
+0 indicates that the QUIC stack must discard this newly created B<SSL> object,
+implying that the associated new connection will not be available for handling
+on a subsequent call to SSL_accept_connection().  A nonzero return
+value is treated as success, allowing the new connection to be enqueued to the
+accept queue.
+
+=head1 HISTORY
+
+SSL_CTX_set_new_pending_conn_cb() was added in OpenSSL 3.5
+
+=head1 COPYRIGHT
+
+Copyright 2025 The OpenSSL Project Authors. All Rights Reserved.
+
+Licensed under the Apache License 2.0 (the "License").  You may not use
+this file except in compliance with the License.  You can obtain a copy
+in the file LICENSE in the source distribution or at
+L<https://www.openssl.org/source/license.html>.
+
+=cut
diff --git a/doc/man3/SSL_CTX_set_new_pending_ssl_cb.pod b/doc/man3/SSL_CTX_set_new_pending_ssl_cb.pod
deleted file mode 100644 (file)
index e4433ed..0000000
+++ /dev/null
@@ -1,48 +0,0 @@
-=pod
-
-=head1 NAME
-
-SSL_CTX_set_new_pending_ssl_cb - callback function to report creation of QUIC connection SSL objects 
-
-=head1 SYNOPSIS
-
- typedef int (*SSL_set_new_pending_ssl_cb_fn)(SSL_CTX *c, SSL *new_ssl,
-                                               void *arg);
- void SSL_CTX_set_new_pending_ssl_cb(SSL_CTX *c,
-                                     SSL_set_new_pending_ssl_cb_fn *f,
-                                     void *arg);
-
-=head1 DESCRIPTION
-
-SSL_CTX_set_new_pending_ssl_cb() sets the new_pending_ssl callback function and
-associated application data argument I<arg>.  When using the QUIC transport, TLS
-handshake processing may occur independently from the thread which accepts the
-connection that the handshake is establishing.  As such, B<SSL> objects
-representing the connection may be allocated and initialized prior to a call to
-SSL_accept_connection().
-
-=head1 RETURN VALUES
-
-SSL_CTX_set_new_pending_ssl_cb() returns no value.
-
-SSL_set_new_pending_ssl_cb_fn() must return an integer value.  A return value of
-0 indicates that the QUIC stack should discard this newly created B<SSL> object,
-implying that the associated new connection will not be available for handling
-on a subsequent call to SSL_accept_connection().  Any other non-zero return
-value is treated as success, allowing the new connection to be enqueued to the
-accept queue.
-
-=head1 HISTORY
-
-SSL_CTX_set_new_pending_ssl_cb() was added in OpenSSL 3.5.0
-
-=head1 COPYRIGHT
-
-Copyright 2024 The OpenSSL Project Authors. All Rights Reserved.
-
-Licensed under the Apache License 2.0 (the "License").  You may not use
-this file except in compliance with the License.  You can obtain a copy
-in the file LICENSE in the source distribution or at
-L<https://www.openssl.org/source/license.html>.
-
-=cut
index 4cb03a24649258b6c958a56ee67dea8b9090bb52..9ba1ab21f4d16c0614160695eb9556ca7cb0c289 100644 (file)
@@ -1897,10 +1897,10 @@ OSSL_DEPRECATEDIN_3_0 __owur char *SSL_get_srp_userinfo(SSL *s);
 typedef int (*SSL_client_hello_cb_fn) (SSL *s, int *al, void *arg);
 void SSL_CTX_set_client_hello_cb(SSL_CTX *c, SSL_client_hello_cb_fn cb,
                                  void *arg);
-typedef int (*SSL_new_pending_ssl_cb_fn) (SSL_CTX *ctx, SSL *new_ssl,
+typedef int (*SSL_new_pending_conn_cb_fn) (SSL_CTX *ctx, SSL *new_ssl,
                                            void *arg);
-void SSL_CTX_set_new_pending_ssl_cb(SSL_CTX *c, SSL_new_pending_ssl_cb_fn cb,
-                                    void *arg);
+void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c, SSL_new_pending_conn_cb_fn cb,
+                                     void *arg);
 
 int SSL_client_hello_isv2(SSL *s);
 unsigned int SSL_client_hello_get0_legacy_version(SSL *s);
index 8ade740af34a0e840b4ff20fb648934cc4ce9fab..36877ab8063591e74c2380e01c04b150727d63e4 100644 (file)
@@ -472,12 +472,12 @@ static SSL *port_new_handshake_layer(QUIC_PORT *port, QUIC_CHANNEL *ch)
     if (qc != NULL)
         qc->tls = tls;
 
-    if (ql != NULL && ql->obj.ssl.ctx->new_pending_ssl_cb != NULL)
-        if (!ql->obj.ssl.ctx->new_pending_ssl_cb(ql->obj.ssl.ctx, user_ssl,
-                                                 ql->obj.ssl.ctx->new_pending_ssl_arg)) {
+    if (ql != NULL && ql->obj.ssl.ctx->new_pending_conn_cb != NULL)
+        if (!ql->obj.ssl.ctx->new_pending_conn_cb(ql->obj.ssl.ctx, user_ssl,
+                                                  ql->obj.ssl.ctx->new_pending_conn_arg)) {
             SSL_free(tls);
             return NULL;
-    }
+        }
 
     /* Override the user_ssl of the inner connection. */
     tls_conn->s3.flags      |= TLS1_FLAGS_QUIC;
index ede2b286eb108e0e224658286ec217366f224d4e..2ba86454d44ba207fa8c90eb5da673a4a399d8d4 100644 (file)
@@ -6660,11 +6660,11 @@ void SSL_CTX_set_client_hello_cb(SSL_CTX *c, SSL_client_hello_cb_fn cb,
     c->client_hello_cb_arg = arg;
 }
 
-void SSL_CTX_set_new_pending_ssl_cb(SSL_CTX *c, SSL_new_pending_ssl_cb_fn cb,
-                                    void *arg)
+void SSL_CTX_set_new_pending_conn_cb(SSL_CTX *c, SSL_new_pending_conn_cb_fn cb,
+                                     void *arg)
 {
-    c->new_pending_ssl_cb = cb;
-    c->new_pending_ssl_arg = arg;
+    c->new_pending_conn_cb = cb;
+    c->new_pending_conn_arg = arg;
 }
 
 int SSL_client_hello_isv2(SSL *s)
index badc1965ea462cb22d75220a1beb960162b9483d..1b201ca679284084c0d333c13d3cf4d6833c16a4 100644 (file)
@@ -983,8 +983,8 @@ struct ssl_ctx_st {
     void *client_hello_cb_arg;
 
     /* Callback to announce new pending ssl objects in the accept queue */
-    SSL_new_pending_ssl_cb_fn new_pending_ssl_cb;
-    void *new_pending_ssl_arg;
+    SSL_new_pending_conn_cb_fn new_pending_conn_cb;
+    void *new_pending_conn_arg;
 
     /* TLS extensions. */
     struct {
index 0b7647dd018acd2a837828ba94ab5b6c4f24ea4e..5f7b1406805e0f43063e8a2a6c39dfba5aaa5e78 100644 (file)
@@ -204,7 +204,7 @@ DEF_FUNC(hf_new_ssl)
             goto err;
 
     } else if (is_server) {
-        SSL_CTX_set_new_pending_ssl_cb(ctx, new_pending_cb, NULL);
+        SSL_CTX_set_new_pending_conn_cb(ctx, new_pending_cb, NULL);
         SSL_CTX_set_client_hello_cb(ctx, client_hello_cb, NULL);
         check_pending_match = 1;
         if (!TEST_ptr(ssl = SSL_new_listener(ctx, 0)))
index 0b584eefedbd215c82caf5ce9ad82cbf2aa64692..4dad12e777532f0ac42fe3af8e7e73ca5f0674aa 100644 (file)
@@ -110,6 +110,7 @@ SSL_psk_client_cb_func                  datatype
 SSL_psk_find_session_cb_func            datatype
 SSL_psk_server_cb_func                  datatype
 SSL_psk_use_session_cb_func             datatype
+SSL_set_new_pending_conn_cb_fn          datatype
 SSL_verify_cb                           datatype
 UI                                      datatype
 UI_METHOD                               datatype