mirror of https://github.com/openssl/openssl.git
QUIC APL: Add skeleton listener API methods
Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Neil Horman <nhorman@openssl.org> (Merged from https://github.com/openssl/openssl/pull/23334)
This commit is contained in:
parent
b67be72a5d
commit
a68287adeb
|
@ -77,6 +77,7 @@ __owur int ossl_quic_conn_set_initial_peer_addr(SSL *s,
|
||||||
const BIO_ADDR *peer_addr);
|
const BIO_ADDR *peer_addr);
|
||||||
__owur SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags);
|
__owur SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags);
|
||||||
__owur SSL *ossl_quic_get0_connection(SSL *s);
|
__owur SSL *ossl_quic_get0_connection(SSL *s);
|
||||||
|
__owur SSL *ossl_quic_get0_listener(SSL *s);
|
||||||
__owur int ossl_quic_get_stream_type(SSL *s);
|
__owur int ossl_quic_get_stream_type(SSL *s);
|
||||||
__owur uint64_t ossl_quic_get_stream_id(SSL *s);
|
__owur uint64_t ossl_quic_get_stream_id(SSL *s);
|
||||||
__owur int ossl_quic_is_stream_local(SSL *s);
|
__owur int ossl_quic_is_stream_local(SSL *s);
|
||||||
|
@ -91,6 +92,9 @@ __owur int ossl_quic_get_value_uint(SSL *s, uint32_t class_, uint32_t id,
|
||||||
uint64_t *value);
|
uint64_t *value);
|
||||||
__owur int ossl_quic_set_value_uint(SSL *s, uint32_t class_, uint32_t id,
|
__owur int ossl_quic_set_value_uint(SSL *s, uint32_t class_, uint32_t id,
|
||||||
uint64_t value);
|
uint64_t value);
|
||||||
|
__owur SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags);
|
||||||
|
__owur size_t ossl_quic_get_accept_connection_queue_len(SSL *ssl);
|
||||||
|
__owur int ossl_quic_listen(SSL *ssl);
|
||||||
|
|
||||||
__owur int ossl_quic_stream_reset(SSL *ssl,
|
__owur int ossl_quic_stream_reset(SSL *ssl,
|
||||||
const SSL_STREAM_RESET_ARGS *args,
|
const SSL_STREAM_RESET_ARGS *args,
|
||||||
|
|
|
@ -2302,7 +2302,12 @@ __owur int SSL_set1_initial_peer_addr(SSL *s, const BIO_ADDR *peer_addr);
|
||||||
__owur SSL *SSL_get0_connection(SSL *s);
|
__owur SSL *SSL_get0_connection(SSL *s);
|
||||||
__owur int SSL_is_connection(SSL *s);
|
__owur int SSL_is_connection(SSL *s);
|
||||||
|
|
||||||
|
__owur int SSL_is_listener(SSL *ssl);
|
||||||
|
__owur SSL *SSL_get0_listener(SSL *s);
|
||||||
__owur SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags);
|
__owur SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags);
|
||||||
|
__owur SSL *SSL_accept_connection(SSL *ssl, uint64_t flags);
|
||||||
|
__owur size_t SSL_get_accept_connection_queue_len(SSL *ssl);
|
||||||
|
__owur int SSL_listen(SSL *ssl);
|
||||||
|
|
||||||
#define SSL_STREAM_TYPE_NONE 0
|
#define SSL_STREAM_TYPE_NONE 0
|
||||||
#define SSL_STREAM_TYPE_READ (1U << 0)
|
#define SSL_STREAM_TYPE_READ (1U << 0)
|
||||||
|
|
|
@ -3016,6 +3016,20 @@ SSL *ossl_quic_get0_connection(SSL *s)
|
||||||
return &ctx.qc->obj.ssl;
|
return &ctx.qc->obj.ssl;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*
|
||||||
|
* SSL_get0_listener
|
||||||
|
* -----------------
|
||||||
|
*/
|
||||||
|
SSL *ossl_quic_get0_listener(SSL *s)
|
||||||
|
{
|
||||||
|
QCTX ctx;
|
||||||
|
|
||||||
|
if (!expect_quic(s, &ctx))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return NULL; // XXX TODO
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* SSL_get_stream_type
|
* SSL_get_stream_type
|
||||||
* -------------------
|
* -------------------
|
||||||
|
@ -4005,6 +4019,21 @@ err:
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSL *ossl_quic_accept_connection(SSL *ssl, uint64_t flags)
|
||||||
|
{
|
||||||
|
return NULL; // TODO XXX
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t ossl_quic_get_accept_connection_queue_len(SSL *ssl)
|
||||||
|
{
|
||||||
|
return 0; // TODO XXX
|
||||||
|
}
|
||||||
|
|
||||||
|
int ossl_quic_listen(SSL *ssl)
|
||||||
|
{
|
||||||
|
return 0; // TODO XXX
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* QUIC Front-End I/O API: SSL_CTX Management
|
* QUIC Front-End I/O API: SSL_CTX Management
|
||||||
* ==========================================
|
* ==========================================
|
||||||
|
|
|
@ -7698,6 +7698,23 @@ int SSL_is_connection(SSL *s)
|
||||||
return SSL_get0_connection(s) == s;
|
return SSL_get0_connection(s) == s;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSL *SSL_get0_listener(SSL *s)
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_NO_QUIC
|
||||||
|
if (!IS_QUIC(s))
|
||||||
|
return s;
|
||||||
|
|
||||||
|
return ossl_quic_get0_listener(s);
|
||||||
|
#else
|
||||||
|
return s;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int SSL_is_listener(SSL *s)
|
||||||
|
{
|
||||||
|
return SSL_get0_listener(s) == s;
|
||||||
|
}
|
||||||
|
|
||||||
int SSL_get_stream_type(SSL *s)
|
int SSL_get_stream_type(SSL *s)
|
||||||
{
|
{
|
||||||
#ifndef OPENSSL_NO_QUIC
|
#ifndef OPENSSL_NO_QUIC
|
||||||
|
@ -7893,6 +7910,42 @@ SSL *SSL_new_listener(SSL_CTX *ctx, uint64_t flags)
|
||||||
#endif
|
#endif
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SSL *SSL_accept_connection(SSL *ssl, uint64_t flags)
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_NO_QUIC
|
||||||
|
if (!IS_QUIC(ssl))
|
||||||
|
return NULL;
|
||||||
|
|
||||||
|
return ossl_quic_accept_connection(ssl, flags);
|
||||||
|
#else
|
||||||
|
return NULL;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
size_t SSL_get_accept_connection_queue_len(SSL *ssl)
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_NO_QUIC
|
||||||
|
if (!IS_QUIC(ssl))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return ossl_quic_get_accept_connection_queue_len(ssl);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
|
int SSL_listen(SSL *ssl)
|
||||||
|
{
|
||||||
|
#ifndef OPENSSL_NO_QUIC
|
||||||
|
if (!IS_QUIC(ssl))
|
||||||
|
return 0;
|
||||||
|
|
||||||
|
return ossl_quic_listen(ssl);
|
||||||
|
#else
|
||||||
|
return 0;
|
||||||
|
#endif
|
||||||
|
}
|
||||||
|
|
||||||
int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk)
|
int SSL_add_expected_rpk(SSL *s, EVP_PKEY *rpk)
|
||||||
{
|
{
|
||||||
unsigned char *data = NULL;
|
unsigned char *data = NULL;
|
||||||
|
|
Loading…
Reference in New Issue