From: Hugo Landau Date: Thu, 18 Jan 2024 15:23:38 +0000 (+0000) Subject: QUIC APL: Add TODOs for unfinished listener APIs X-Git-Tag: openssl-3.5.0-alpha1~452 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=7efebeb172a934c1ef32b9f446ec02ff5e6f416c;p=thirdparty%2Fopenssl.git QUIC APL: Add TODOs for unfinished listener APIs Reviewed-by: Matt Caswell Reviewed-by: Neil Horman (Merged from https://github.com/openssl/openssl/pull/23334) --- diff --git a/include/internal/quic_ssl.h b/include/internal/quic_ssl.h index f0dcf59ba0b..ce7142c51f5 100644 --- a/include/internal/quic_ssl.h +++ b/include/internal/quic_ssl.h @@ -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); diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 9a4062e916f..457d97af851 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -4022,6 +4022,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; @@ -4056,6 +4060,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. */ @@ -4073,6 +4079,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 * ---------- @@ -4123,7 +4139,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) { diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index 1438107ae91..2a575a7598b 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -7910,6 +7910,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