Update SSL options handling
authorHugo Landau <hlandau@openssl.org>
Mon, 3 Jul 2023 07:17:48 +0000 (08:17 +0100)
committerPauli <pauli@openssl.org>
Tue, 4 Jul 2023 23:03:04 +0000 (09:03 +1000)
Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/20061)

ssl/quic/quic_impl.c

index c0232495da0bfd4ede150dc953cd873c56dd2882..696a660cd4d21c0da4f3a02cc4064e751bebf62b 100644 (file)
@@ -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
  * =====================