From 18ca1c8fc074e5b0fe52c91c52ade23e1f14cd0e Mon Sep 17 00:00:00 2001 From: Hugo Landau Date: Mon, 3 Jul 2023 08:17:48 +0100 Subject: [PATCH] Update SSL options handling Reviewed-by: Tomas Mraz Reviewed-by: Matt Caswell Reviewed-by: Paul Dale (Merged from https://github.com/openssl/openssl/pull/20061) --- ssl/quic/quic_impl.c | 35 ++++++++--------------------------- 1 file changed, 8 insertions(+), 27 deletions(-) diff --git a/ssl/quic/quic_impl.c b/ssl/quic/quic_impl.c index c0232495da0..696a660cd4d 100644 --- a/ssl/quic/quic_impl.c +++ b/ssl/quic/quic_impl.c @@ -637,11 +637,14 @@ static uint64_t quic_mask_or_options(SSL *ssl, uint64_t mask_value, uint64_t or_ SSL_clear_options(ctx.qc->tls, mask_value); options = SSL_set_options(ctx.qc->tls, or_value); - if (ctx.xso != NULL - && ctx.xso->stream != NULL - && ctx.xso->stream->rstream != NULL) - ossl_quic_rstream_set_cleanse(ctx.xso->stream->rstream, - (options & SSL_OP_CLEANSE_PLAINTEXT) != 0); + if (ctx.xso != NULL && ctx.xso->stream != NULL) { + int cleanse = ((options & SSL_OP_CLEANSE_PLAINTEXT) != 0); + + if (ctx.xso->stream->rstream != NULL) + ossl_quic_rstream_set_cleanse(ctx.xso->stream->rstream, cleanse); + if (ctx.xso->stream->sstream != NULL) + ossl_quic_sstream_set_cleanse(ctx.xso->stream->sstream, cleanse); + } quic_unlock(ctx.qc); return options; @@ -2863,28 +2866,6 @@ const SSL_CIPHER *ossl_quic_get_cipher(unsigned int u) return NULL; } -int ossl_quic_set_ssl_op(SSL *ssl, uint64_t op) -{ - QCTX ctx; - int cleanse; - - if (!expect_quic_with_stream_lock(ssl, /*remote_init=*/-1, &ctx)) - return 0; - - if (ctx.xso->stream == NULL) - goto out; - - cleanse = (op & SSL_OP_CLEANSE_PLAINTEXT) != 0; - if (ctx.xso->stream->rstream != NULL) - ossl_quic_rstream_set_cleanse(ctx.xso->stream->rstream, cleanse); - if (ctx.xso->stream->sstream != NULL) - ossl_quic_sstream_set_cleanse(ctx.xso->stream->sstream, cleanse); - - out: - quic_unlock(ctx.qc); - return 1; -} - /* * Internal Testing APIs * ===================== -- 2.47.2