Support SSL_OP_CLEANSE_PLAINTEXT on QUIC streams
[openssl.git] / ssl / quic / quic_impl.c
index 4f379e32ed2e550fcecc7cf181a80e407b1269a0..d2a79feb61b164688ea15724ace4eaf4126ce81f 100644 (file)
@@ -2798,6 +2798,24 @@ 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;
+
+    if (!expect_quic_with_stream_lock(ssl, /*remote_init=*/-1, &ctx))
+        return 0;
+
+    if (ctx.xso->stream == NULL || ctx.xso->stream->rstream == NULL)
+        goto out;
+
+    ossl_quic_rstream_set_cleanse(ctx.xso->stream->rstream,
+                                  (op & SSL_OP_CLEANSE_PLAINTEXT) != 0);
+
+ out:
+    quic_unlock(ctx.qc);
+    return 1;
+}
+
 /*
  * Internal Testing APIs
  * =====================