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,
+ void *arg);
+void SSL_CTX_set_new_pending_ssl_cb(SSL_CTX *c, SSL_new_pending_ssl_cb_fn cb,
+ void *arg);
+
int SSL_client_hello_isv2(SSL *s);
unsigned int SSL_client_hello_get0_legacy_version(SSL *s);
size_t SSL_client_hello_get0_random(SSL *s, const unsigned char **out);
SSL_CONNECTION *tls_conn = NULL;
SSL *user_ssl = NULL;
QUIC_CONNECTION *qc = NULL;
+ QUIC_LISTENER *ql = NULL;
if (port->get_conn_user_ssl != NULL) {
user_ssl = port->get_conn_user_ssl(ch, port->user_ssl_arg);
if (user_ssl == NULL)
return NULL;
qc = (QUIC_CONNECTION *)user_ssl;
+ ql = (QUIC_LISTENER *)port->user_ssl_arg;
}
tls = ossl_ssl_connection_new_int(port->channel_ctx, user_ssl, TLS_method());
qc->tls = tls;
if (ql != NULL && ql->obj.ssl.ctx->new_pending_ssl_cb != NULL)
- ql->obj.ssl.ctx->new_pending_ssl_cb(ql->obj.ssl.ctx, user_ssl,
- ql->obj.ssl.ctx->new_pending_ssl_arg);
+ if (!ql->obj.ssl.ctx->new_pending_ssl_cb(ql->obj.ssl.ctx, user_ssl,
+ ql->obj.ssl.ctx->new_pending_ssl_arg)) {
+ SSL_free(tls);
+ return NULL;
+ }
/* Override the user_ssl of the inner connection. */
tls_conn->s3.flags |= TLS1_FLAGS_QUIC;
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)
+{
+ c->new_pending_ssl_cb = cb;
+ c->new_pending_ssl_arg = arg;
+}
+
int SSL_client_hello_isv2(SSL *s)
{
const SSL_CONNECTION *sc = SSL_CONNECTION_FROM_SSL(s);
SSL_client_hello_cb_fn client_hello_cb;
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;
+
/* TLS extensions. */
struct {
/* TLS extensions servername callback */