summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2023-08-31 11:52:38 +0100
committerHugo Landau <hlandau@openssl.org>2023-09-01 14:44:46 +0100
commit56df4cf24fad554e173d950a79a516e730096055 (patch)
treefcae32083f9eeffd1fca8cd8fd6202a8d5785f92
parent8c792b0ccd41657d9972efbcc997a0c39d49121f (diff)
QUIC APL: Adjust expect_quic_conn_only
Reviewed-by: Tomas Mraz <tomas@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21915)
-rw-r--r--ssl/quic/quic_impl.c25
1 files changed, 12 insertions, 13 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index a9945fec43..5dd73fd19b 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -277,12 +277,11 @@ err:
* Like expect_quic(), but fails if called on a QUIC_XSO. ctx->xso may still
* be non-NULL if the QCSO has a default stream.
*/
-static int ossl_unused expect_quic_conn_only(const SSL *s, int in_io, QCTX *ctx)
+static int ossl_unused expect_quic_conn_only(const SSL *s, QCTX *ctx)
{
if (!expect_quic(s, ctx))
return 0;
- ctx->in_io = in_io;
if (ctx->is_stream)
return QUIC_RAISE_NON_NORMAL_ERROR(ctx, SSL_R_CONN_USE_ONLY, NULL);
@@ -1985,7 +1984,7 @@ SSL *ossl_quic_conn_stream_new(SSL *s, uint64_t flags)
{
QCTX ctx;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return NULL;
return quic_conn_stream_new(&ctx, flags, /*need_lock=*/1);
@@ -2835,7 +2834,7 @@ int ossl_quic_set_default_stream_mode(SSL *s, uint32_t mode)
{
QCTX ctx;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return 0;
quic_lock(ctx.qc);
@@ -2872,7 +2871,7 @@ SSL *ossl_quic_detach_stream(SSL *s)
QCTX ctx;
QUIC_XSO *xso = NULL;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return NULL;
quic_lock(ctx.qc);
@@ -2897,7 +2896,7 @@ int ossl_quic_attach_stream(SSL *conn, SSL *stream)
QUIC_XSO *xso;
int nref;
- if (!expect_quic_conn_only(conn, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(conn, &ctx))
return 0;
if (stream == NULL || stream->type != SSL_TYPE_QUIC_XSO)
@@ -2977,7 +2976,7 @@ int ossl_quic_set_incoming_stream_policy(SSL *s, int policy,
int ret = 1;
QCTX ctx;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return 0;
quic_lock(ctx.qc);
@@ -3041,7 +3040,7 @@ SSL *ossl_quic_accept_stream(SSL *s, uint64_t flags)
QUIC_XSO *xso;
OSSL_RTT_INFO rtt_info;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return NULL;
quic_lock(ctx.qc);
@@ -3104,7 +3103,7 @@ size_t ossl_quic_get_accept_stream_queue_len(SSL *s)
QCTX ctx;
size_t v;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return 0;
quic_lock(ctx.qc);
@@ -3331,7 +3330,7 @@ int ossl_quic_get_conn_close_info(SSL *ssl,
QCTX ctx;
const QUIC_TERMINATE_CAUSE *tc;
- if (!expect_quic_conn_only(ssl, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(ssl, &ctx))
return -1;
tc = ossl_quic_channel_get_terminate_cause(ctx.qc->ch);
@@ -3357,7 +3356,7 @@ int ossl_quic_key_update(SSL *ssl, int update_type)
{
QCTX ctx;
- if (!expect_quic_conn_only(ssl, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(ssl, &ctx))
return 0;
switch (update_type) {
@@ -3417,7 +3416,7 @@ long ossl_quic_callback_ctrl(SSL *s, int cmd, void (*fp) (void))
{
QCTX ctx;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return 0;
switch (cmd) {
@@ -3468,7 +3467,7 @@ QUIC_CHANNEL *ossl_quic_conn_get_channel(SSL *s)
{
QCTX ctx;
- if (!expect_quic_conn_only(s, /*io=*/0, &ctx))
+ if (!expect_quic_conn_only(s, &ctx))
return NULL;
return ctx.qc->ch;