Skip to content

Commit

Permalink
QUIC APL: Add TODOs for unfinished listener APIs
Browse files Browse the repository at this point in the history
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Neil Horman <nhorman@openssl.org>
(Merged from #23334)
  • Loading branch information
hlandau committed Apr 19, 2024
1 parent b792ed2 commit 0a0bdef
Show file tree
Hide file tree
Showing 3 changed files with 31 additions and 1 deletion.
1 change: 1 addition & 0 deletions include/internal/quic_ssl.h
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
19 changes: 18 additions & 1 deletion ssl/quic/quic_impl.c
Original file line number Diff line number Diff line change
Expand Up @@ -4004,6 +4004,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;
Expand Down Expand Up @@ -4038,6 +4042,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. */
Expand All @@ -4055,6 +4061,16 @@ SSL *ossl_quic_new_listener(SSL_CTX *ctx, uint64_t flags)
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
* ----------
Expand Down Expand Up @@ -4105,7 +4121,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) {
Expand Down
12 changes: 12 additions & 0 deletions ssl/ssl_lib.c
Original file line number Diff line number Diff line change
Expand Up @@ -7692,6 +7692,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
Expand Down

0 comments on commit 0a0bdef

Please sign in to comment.