diff options
author | Hugo Landau <hlandau@openssl.org> | 2023-05-08 19:52:45 +0100 |
---|---|---|
committer | Hugo Landau <hlandau@openssl.org> | 2023-05-12 14:47:15 +0100 |
commit | 83df44ae53c3c3bb1e79785af38ab52bb4f865cb (patch) | |
tree | bd14faf149ba8be864620b4d80bb9f9c776d0a13 /ssl | |
parent | bb9b8a333ffaf998e60016819ee1e8c2da58f0fd (diff) | |
download | openssl-new-83df44ae53c3c3bb1e79785af38ab52bb4f865cb.tar.gz |
QUIC MSST: Rename SSL_set_incoming_stream_reject_policy
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20765)
Diffstat (limited to 'ssl')
-rw-r--r-- | ssl/quic/quic_impl.c | 43 | ||||
-rw-r--r-- | ssl/quic/quic_local.h | 6 | ||||
-rw-r--r-- | ssl/ssl_lib.c | 4 |
3 files changed, 26 insertions, 27 deletions
diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index 0826a170d4..4706756b26 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -303,8 +303,7 @@ SSL *ossl_quic_new(SSL_CTX *ctx) qc->default_stream_mode = SSL_DEFAULT_STREAM_MODE_AUTO_BIDI; qc->default_ssl_mode = qc->ssl.ctx->mode; qc->default_blocking = 1; - qc->incoming_stream_reject_policy - = SSL_INCOMING_STREAM_REJECT_POLICY_AUTO; + qc->incoming_stream_policy = SSL_INCOMING_STREAM_POLICY_AUTO; qc->last_error = SSL_ERROR_NONE; if (!create_channel(qc)) @@ -2238,39 +2237,39 @@ int ossl_quic_attach_stream(SSL *conn, SSL *stream) } /* - * SSL_set_incoming_stream_reject_policy - * ------------------------------------- + * SSL_set_incoming_stream_policy + * ------------------------------ */ QUIC_NEEDS_LOCK -static int qc_get_effective_incoming_stream_reject_policy(QUIC_CONNECTION *qc) +static int qc_get_effective_incoming_stream_policy(QUIC_CONNECTION *qc) { - switch (qc->incoming_stream_reject_policy) { - case SSL_INCOMING_STREAM_REJECT_POLICY_AUTO: + switch (qc->incoming_stream_policy) { + case SSL_INCOMING_STREAM_POLICY_AUTO: if ((qc->default_xso == NULL && !qc->default_xso_created) || qc->default_stream_mode == SSL_DEFAULT_STREAM_MODE_NONE) - return SSL_INCOMING_STREAM_REJECT_POLICY_ACCEPT; + return SSL_INCOMING_STREAM_POLICY_ACCEPT; else - return SSL_INCOMING_STREAM_REJECT_POLICY_REJECT; + return SSL_INCOMING_STREAM_POLICY_REJECT; default: - return qc->incoming_stream_reject_policy; + return qc->incoming_stream_policy; } } QUIC_NEEDS_LOCK static void qc_update_reject_policy(QUIC_CONNECTION *qc) { - int policy = qc_get_effective_incoming_stream_reject_policy(qc); - int enable_reject = (policy == SSL_INCOMING_STREAM_REJECT_POLICY_REJECT); + int policy = qc_get_effective_incoming_stream_policy(qc); + int enable_reject = (policy == SSL_INCOMING_STREAM_POLICY_REJECT); ossl_quic_channel_set_incoming_stream_auto_reject(qc->ch, enable_reject, - qc->incoming_stream_reject_aec); + qc->incoming_stream_aec); } QUIC_TAKES_LOCK -int ossl_quic_set_incoming_stream_reject_policy(SSL *s, int policy, - uint64_t aec) +int ossl_quic_set_incoming_stream_policy(SSL *s, int policy, + uint64_t aec) { int ret = 1; QCTX ctx; @@ -2281,11 +2280,11 @@ int ossl_quic_set_incoming_stream_reject_policy(SSL *s, int policy, quic_lock(ctx.qc); switch (policy) { - case SSL_INCOMING_STREAM_REJECT_POLICY_AUTO: - case SSL_INCOMING_STREAM_REJECT_POLICY_ACCEPT: - case SSL_INCOMING_STREAM_REJECT_POLICY_REJECT: - ctx.qc->incoming_stream_reject_policy = policy; - ctx.qc->incoming_stream_reject_aec = aec; + case SSL_INCOMING_STREAM_POLICY_AUTO: + case SSL_INCOMING_STREAM_POLICY_ACCEPT: + case SSL_INCOMING_STREAM_POLICY_REJECT: + ctx.qc->incoming_stream_policy = policy; + ctx.qc->incoming_stream_aec = aec; break; default: @@ -2342,8 +2341,8 @@ SSL *ossl_quic_accept_stream(SSL *s, uint64_t flags) quic_lock(ctx.qc); - if (qc_get_effective_incoming_stream_reject_policy(ctx.qc) - == SSL_INCOMING_STREAM_REJECT_POLICY_REJECT) + if (qc_get_effective_incoming_stream_policy(ctx.qc) + == SSL_INCOMING_STREAM_POLICY_REJECT) goto out; qsm = ossl_quic_channel_get_qsm(ctx.qc->ch); diff --git a/ssl/quic/quic_local.h b/ssl/quic/quic_local.h index 6e062089f0..a23d039e9c 100644 --- a/ssl/quic/quic_local.h +++ b/ssl/quic/quic_local.h @@ -178,9 +178,9 @@ struct quic_conn_st { /* SSL_set_mode. This is not used directly but inherited by new XSOs. */ uint32_t default_ssl_mode; - /* SSL_set_incoming_stream_reject_policy. */ - int incoming_stream_reject_policy; - uint64_t incoming_stream_reject_aec; + /* SSL_set_incoming_stream_policy. */ + int incoming_stream_policy; + uint64_t incoming_stream_aec; /* * Last 'normal' error during an app-level I/O operation, used by diff --git a/ssl/ssl_lib.c b/ssl/ssl_lib.c index f7e3f497b8..4be70ce60f 100644 --- a/ssl/ssl_lib.c +++ b/ssl/ssl_lib.c @@ -7385,13 +7385,13 @@ int SSL_attach_stream(SSL *conn, SSL *stream) #endif } -int SSL_set_incoming_stream_reject_policy(SSL *s, int policy, uint64_t aec) +int SSL_set_incoming_stream_policy(SSL *s, int policy, uint64_t aec) { #ifndef OPENSSL_NO_QUIC if (!IS_QUIC(s)) return 0; - return ossl_quic_set_incoming_stream_reject_policy(s, policy, aec); + return ossl_quic_set_incoming_stream_policy(s, policy, aec); #else return 0; #endif |