summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHugo Landau <hlandau@openssl.org>2024-04-04 09:04:39 +0100
committerHugo Landau <hlandau@openssl.org>2024-04-19 09:33:53 +0100
commit7c0e134d73677dc92cff123f89266f49e86ef9b6 (patch)
tree84cfbf0320287376fb6f53817a47da883a7c528f
parenta263fbba74ab7e9369082091fe000a1b17f6d3f7 (diff)
QUIC APL: Make prologue function names more descriptive
Reviewed-by: Neil Horman <nhorman@openssl.org> Reviewed-by: Tomas Mraz <tomas@openssl.org> (Merged from https://github.com/openssl/openssl/pull/24037)
-rw-r--r--ssl/quic/quic_impl.c76
1 files changed, 38 insertions, 38 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c
index 9cca7db9ac..ba2e003d87 100644
--- a/ssl/quic/quic_impl.c
+++ b/ssl/quic/quic_impl.c
@@ -367,12 +367,12 @@ err:
}
-static int expect_quic(const SSL *s, QCTX *ctx)
+static int expect_quic_cs(const SSL *s, QCTX *ctx)
{
return expect_quic_as(s, ctx, QCTX_C | QCTX_S);
}
-static int expect_quic_any(const SSL *s, QCTX *ctx)
+static int expect_quic_csl(const SSL *s, QCTX *ctx)
{
return expect_quic_as(s, ctx, QCTX_C | QCTX_S | QCTX_L);
}
@@ -383,7 +383,7 @@ static int expect_quic_listener(const SSL *s, QCTX *ctx)
}
/*
- * Like expect_quic(), but requires a QUIC_XSO be contextually available. In
+ * Like expect_quic_cs(), but requires a QUIC_XSO be contextually available. In
* other words, requires that the passed QSO be a QSSO or a QCSO with a default
* stream.
*
@@ -411,7 +411,7 @@ static int ossl_unused expect_quic_with_stream_lock(const SSL *s, int remote_ini
}
/*
- * Like expect_quic(), but fails if called on a QUIC_XSO. ctx->xso may still
+ * Like expect_quic_cs(), 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, QCTX *ctx)
@@ -671,7 +671,7 @@ void ossl_quic_free(SSL *s)
int is_default;
/* We should never be called on anything but a QSO. */
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return;
if (ctx.is_listener) {
@@ -779,7 +779,7 @@ int ossl_quic_reset(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
ERR_raise(ERR_LIB_SSL, ERR_R_UNSUPPORTED);
@@ -791,7 +791,7 @@ int ossl_quic_clear(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
ERR_raise(ERR_LIB_SSL, ERR_R_UNSUPPORTED);
@@ -804,7 +804,7 @@ int ossl_quic_conn_set_override_now_cb(SSL *s,
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -820,7 +820,7 @@ void ossl_quic_conn_force_assist_thread_wake(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return;
#if !defined(OPENSSL_NO_QUIC_THREAD_ASSIST)
@@ -927,7 +927,7 @@ static uint64_t quic_mask_or_options(SSL *ssl, uint64_t mask_value, uint64_t or_
QCTX ctx;
uint64_t hs_mask_value, hs_or_value, ret;
- if (!expect_quic(ssl, &ctx))
+ if (!expect_quic_cs(ssl, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1113,7 +1113,7 @@ void ossl_quic_conn_set0_net_rbio(SSL *s, BIO *net_rbio)
{
QCTX ctx;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return;
/* Returns 0 if no change. */
@@ -1125,7 +1125,7 @@ void ossl_quic_conn_set0_net_wbio(SSL *s, BIO *net_wbio)
{
QCTX ctx;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return;
/* Returns 0 if no change. */
@@ -1138,7 +1138,7 @@ BIO *ossl_quic_conn_get_net_rbio(const SSL *s)
QCTX ctx;
QUIC_PORT *port;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return NULL;
port = ossl_quic_obj_get0_port(ctx.obj);
@@ -1151,7 +1151,7 @@ BIO *ossl_quic_conn_get_net_wbio(const SSL *s)
QCTX ctx;
QUIC_PORT *port;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return NULL;
port = ossl_quic_obj_get0_port(ctx.obj);
@@ -1163,7 +1163,7 @@ int ossl_quic_conn_get_blocking_mode(const SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
if (ctx.is_stream)
@@ -1178,7 +1178,7 @@ int ossl_quic_conn_set_blocking_mode(SSL *s, int blocking)
int ret = 0;
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1227,7 +1227,7 @@ int ossl_quic_conn_set_initial_peer_addr(SSL *s,
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
if (ctx.qc->started)
@@ -1287,7 +1287,7 @@ int ossl_quic_handle_events(SSL *s)
{
QCTX ctx;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1309,7 +1309,7 @@ int ossl_quic_get_event_timeout(SSL *s, struct timeval *tv, int *is_infinite)
QCTX ctx;
OSSL_TIME deadline = ossl_time_infinite();
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1344,7 +1344,7 @@ int ossl_quic_get_rpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc)
QUIC_PORT *port = NULL;
BIO *net_rbio;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
port = ossl_quic_obj_get0_port(ctx.obj);
@@ -1363,7 +1363,7 @@ int ossl_quic_get_wpoll_descriptor(SSL *s, BIO_POLL_DESCRIPTOR *desc)
QUIC_PORT *port = NULL;
BIO *net_wbio;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return 0;
port = ossl_quic_obj_get0_port(ctx.obj);
@@ -1382,7 +1382,7 @@ int ossl_quic_get_net_read_desired(SSL *s)
QCTX ctx;
int ret;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1398,7 +1398,7 @@ int ossl_quic_get_net_write_desired(SSL *s)
int ret;
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -1479,7 +1479,7 @@ int ossl_quic_conn_shutdown(SSL *s, uint64_t flags,
int no_block = ((flags & SSL_SHUTDOWN_FLAG_NO_BLOCK) != 0);
int wait_peer = ((flags & SSL_SHUTDOWN_FLAG_WAIT_PEER) != 0);
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return -1;
if (ctx.is_stream) {
@@ -1580,7 +1580,7 @@ long ossl_quic_ctrl(SSL *s, int cmd, long larg, void *parg)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
switch (cmd) {
@@ -1658,7 +1658,7 @@ void ossl_quic_set_connect_state(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return;
/* Cannot be changed after handshake started */
@@ -1673,7 +1673,7 @@ void ossl_quic_set_accept_state(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return;
/* Cannot be changed after handshake started */
@@ -1946,7 +1946,7 @@ int ossl_quic_do_handshake(SSL *s)
int ret;
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock_for_io(&ctx);
@@ -2299,7 +2299,7 @@ int ossl_quic_get_error(const SSL *s, int i)
QCTX ctx;
int net_error, last_error;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -2346,7 +2346,7 @@ int ossl_quic_want(const SSL *s)
QCTX ctx;
int w;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return SSL_NOTHING;
qctx_lock(&ctx);
@@ -2945,7 +2945,7 @@ static int quic_read(SSL *s, void *buf, size_t len, size_t *bytes_read, int peek
*bytes_read = 0;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock_for_io(&ctx);
@@ -3056,7 +3056,7 @@ static size_t ossl_quic_pending_int(const SSL *s, int check_channel)
QCTX ctx;
size_t avail = 0;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -3152,7 +3152,7 @@ int SSL_inject_net_dgram(SSL *s, const unsigned char *buf,
QCTX ctx;
QUIC_DEMUX *demux;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return 0;
qctx_lock(&ctx);
@@ -3172,7 +3172,7 @@ SSL *ossl_quic_get0_connection(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return NULL;
return &ctx.qc->obj.ssl;
@@ -3186,7 +3186,7 @@ SSL *ossl_quic_get0_listener(SSL *s)
{
QCTX ctx;
- if (!expect_quic_any(s, &ctx))
+ if (!expect_quic_csl(s, &ctx))
return NULL;
return ctx.ql != NULL ? &ctx.ql->obj.ssl : NULL;
@@ -3200,7 +3200,7 @@ int ossl_quic_get_stream_type(SSL *s)
{
QCTX ctx;
- if (!expect_quic(s, &ctx))
+ if (!expect_quic_cs(s, &ctx))
return SSL_STREAM_TYPE_BIDI;
if (ctx.xso == NULL) {
@@ -3649,7 +3649,7 @@ static int expect_quic_for_value(SSL *s, QCTX *ctx, uint32_t id)
case SSL_VALUE_STREAM_WRITE_BUF_SIZE:
case SSL_VALUE_STREAM_WRITE_BUF_USED:
case SSL_VALUE_STREAM_WRITE_BUF_AVAIL:
- return expect_quic(s, ctx);
+ return expect_quic_cs(s, ctx);
default:
return expect_quic_conn_only(s, ctx);
}
@@ -4525,7 +4525,7 @@ int ossl_quic_conn_poll_events(SSL *ssl, uint64_t events, int do_tick,
QCTX ctx;
uint64_t revents = 0;
- if (!expect_quic(ssl, &ctx))
+ if (!expect_quic_cs(ssl, &ctx))
return 0;
qctx_lock(&ctx);