return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L);
}
+#define expect_quic_any expect_quic_csl
+
static int expect_quic_listener(const SSL *s, QCTX *ctx)
{
return expect_quic_as(s, ctx, QCTX_L);
int is_default;
/* We should never be called on anything but a QSO. */
- if (!expect_quic_csl(s, &ctx))
+ if (!expect_quic_any(s, &ctx))
return;
if (ctx.is_listener) {
{
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_any(s, &ctx))
return 0;
ERR_raise(ERR_LIB_SSL, ERR_R_UNSUPPORTED);
{
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_any(s, &ctx))
return 0;
ERR_raise(ERR_LIB_SSL, ERR_R_UNSUPPORTED);
{
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return 0;
qctx_lock(&ctx);
{
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return;
#if !defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
{
QCTX ctx;
- if (!expect_quic_csl(s, &ctx))
+ if (!expect_quic_any(s, &ctx))
return 0;
qctx_lock(&ctx);
QCTX ctx;
OSSL_TIME deadline = ossl_time_infinite();
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_any(s, &ctx))
return 0;
qctx_lock(&ctx);
QCTX ctx;
int ret;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
qctx_lock(&ctx);
int ret;
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
qctx_lock(&ctx);
{
QCTX ctx;
- if (!expect_quic_cs(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
switch (cmd) {
case SSL_CTRL_MODE:
+ if (ctx.is_listener)
+ return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_UNSUPPORTED, NULL);
+
/* If called on a QCSO, update the default mode. */
if (!ctx.is_stream)
ctx.qc->default_ssl_mode |= (uint32_t)larg;
return ctx.qc->default_ssl_mode;
case SSL_CTRL_CLEAR_MODE:
+ if (ctx.is_listener)
+ return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_UNSUPPORTED, NULL);
+
if (!ctx.is_stream)
ctx.qc->default_ssl_mode &= ~(uint32_t)larg;
return ctx.qc->default_ssl_mode;
case SSL_CTRL_SET_MSG_CALLBACK_ARG:
+ if (ctx.is_listener)
+ return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_UNSUPPORTED, NULL);
+
ossl_quic_channel_set_msg_callback_arg(ctx.qc->ch, parg);
/* This ctrl also needs to be passed to the internal SSL object */
return SSL_ctrl(ctx.qc->tls, cmd, larg, parg);
* supported by anything, the handshake layer's ctrl method will finally
* return 0.
*/
+ if (ctx.is_listener)
+ return QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_UNSUPPORTED, NULL);
+
return ossl_ctrl_internal(&ctx.qc->obj.ssl, cmd, larg, parg, /*no_quic=*/1);
}
}
const BIO_ADDR *peer,
const BIO_ADDR *local)
{
- int ret;
+ int ret = 0;
QCTX ctx;
QUIC_DEMUX *demux;
qctx_lock(&ctx);
- demux = ossl_quic_channel_get0_demux(ctx.qc->ch);
+ if (ctx.obj->port == NULL) {
+ QUIC_RAISE_NON_NORMAL_ERROR(&ctx, ERR_R_UNSUPPORTED, NULL);
+ goto err;
+ }
+
+ demux = ossl_quic_port_get0_demux(ctx.obj->port);
ret = ossl_quic_demux_inject(demux, buf, buf_len, peer, local);
+ ret = 1;
+err:
qctx_unlock(&ctx);
return ret;
}
QCTX ctx;
uint64_t revents = 0;
+ /* TODO(QUIC SERVER): Support listeners */
if (!expect_quic_cs(ssl, &ctx))
return 0;