]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
QUIC APL: Add TODOs for unfinished listener APIs
authorHugo Landau <hlandau@openssl.org>
Thu, 18 Jan 2024 15:23:38 +0000 (15:23 +0000)
committerViktor Dukhovni <openssl-users@dukhovni.org>
Wed, 11 Sep 2024 08:00:08 +0000 (18:00 +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_ssl.h
ssl/quic/quic_impl.c
ssl/ssl_lib.c

index f0dcf59ba0b3cc77e9c0ec0caed472b2c38fe2a9..ce7142c51f5f660ccab773c2c8846f60d4065c6e 100644 (file)
@@ -20,6 +20,7 @@
 
 __owur SSL *ossl_quic_new(SSL_CTX *ctx);
 __owur SSL *ossl_quic_new_listener(SSL_CTX *ctx, uint64_t flags);
+__owur SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags);
 __owur int ossl_quic_init(SSL *s);
 void ossl_quic_deinit(SSL *s);
 void ossl_quic_free(SSL *s);
index 7878f4a9fbb27415bc0363d789d8f1238488fd66..e233032dddf3c1a3e9602792b87411a0bd9f1c93 100644 (file)
@@ -4009,6 +4009,10 @@ int ossl_quic_get_key_update_type(const SSL *s)
  * =================================
  */
 
+/*
+ * SSL_new_listener
+ * ----------------
+ */
 SSL *ossl_quic_new_listener(SSL_CTX *ctx, uint64_t flags)
 {
     QUIC_LISTENER *ql = NULL;
@@ -4043,6 +4047,8 @@ SSL *ossl_quic_new_listener(SSL_CTX *ctx, uint64_t flags)
         goto err;
     }
 
+    /* TODO(QUIC SERVER): Implement SSL_LISTENER_FLAG_NO_ACCEPT */
+
     ossl_quic_port_set_allow_incoming(ql->port, 1);
 
     /* Initialise the QUIC_LISTENER'S object header. */
@@ -4060,6 +4066,16 @@ err:
     return NULL;
 }
 
+/*
+ * SSL_new_from_listener
+ * ---------------------
+ */
+SSL *ossl_quic_new_from_listener(SSL *ssl, uint64_t flags)
+{
+    /* TODO(QUIC SERVER): Implement SSL_new_from_listener */
+    return NULL;
+}
+
 /*
  * SSL_listen
  * ----------
@@ -4110,7 +4126,8 @@ SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags)
     if (!ql_listen(ctx.ql))
         goto out;
 
-    /* TODO autotick/block */
+    /* TODO(QUIC SERVER): Autotick */
+    /* TODO(QUIC SERVER): Implement blocking and SSL_ACCEPT_CONNECTION_NO_BLOCK */
 
     new_ch = ossl_quic_port_pop_incoming(ctx.ql->port);
     if (new_ch == NULL) {
index fabfba2e83faae674a19daeb454cf90f4b686ec7..26ff825dbfeb5a83e6ab5597ab4903944f568ce9 100644 (file)
@@ -7746,6 +7746,18 @@ SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags)
 #endif
 }
 
+SSL *SSL_new_from_listener(SSL *ssl, uint64_t flags)
+{
+#ifndef OPENSSL_NO_QUIC
+    if (!IS_QUIC(ssl))
+        return NULL;
+
+    return ossl_quic_new_from_listener(ssl, flags);
+#else
+    return NULL;
+#endif
+}
+
 SSL *SSL_accept_connection(SSL *ssl, uint64_t flags)
 {
 #ifndef OPENSSL_NO_QUIC