OSSL_QTX_IOVEC *iov,
size_t num_iov);
+/*
+ * Sets flag to cleanse the buffered data when it is acked.
+ */
+void ossl_quic_sstream_set_cleanse(QUIC_SSTREAM *qss, int cleanse);
+
/*
* QUIC Receive Stream Manager
* ===========================
int server_init = ossl_quic_stream_is_server_init(qs);
int local_init = (ch->is_server == server_init);
int is_uni = !ossl_quic_stream_is_bidi(qs);
+ int cleanse = (ch->tls->ctx->options & SSL_OP_CLEANSE_PLAINTEXT) != 0;
- if (can_send && (qs->sstream = ossl_quic_sstream_new(INIT_APP_BUF_LEN)) == NULL)
- goto err;
+ if (can_send) {
+ if ((qs->sstream = ossl_quic_sstream_new(INIT_APP_BUF_LEN)) == NULL)
+ goto err;
+ ossl_quic_sstream_set_cleanse(qs->sstream, cleanse);
+ }
if (can_recv) {
if ((qs->rstream = ossl_quic_rstream_new(NULL, NULL, 0)) == NULL)
goto err;
- ossl_quic_rstream_set_cleanse(qs->rstream,
- (ch->tls->ctx->options
- & SSL_OP_CLEANSE_PLAINTEXT) != 0);
+ ossl_quic_rstream_set_cleanse(qs->rstream, cleanse);
}
/* TXFC */
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 || ctx.xso->stream->rstream == NULL)
+ if (ctx.xso->stream == NULL)
goto out;
- ossl_quic_rstream_set_cleanse(ctx.xso->stream->rstream,
- (op & SSL_OP_CLEANSE_PLAINTEXT) != 0);
+ 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);
unsigned int have_final_size : 1;
unsigned int sent_final_size : 1;
unsigned int acked_final_size : 1;
+ unsigned int cleanse : 1;
};
static void qss_cull(QUIC_SSTREAM *qss);
* can only cull contiguous areas at the start of the ring buffer anyway.
*/
if (h != NULL)
- ring_buf_cpop_range(&qss->ring_buf, h->range.start, h->range.end, 0);
+ ring_buf_cpop_range(&qss->ring_buf, h->range.start, h->range.end,
+ qss->cleanse);
}
int ossl_quic_sstream_set_buffer_size(QUIC_SSTREAM *qss, size_t num_bytes)
running += iovlen;
}
}
+
+void ossl_quic_sstream_set_cleanse(QUIC_SSTREAM *qss, int cleanse)
+{
+ qss->cleanse = cleanse;
+}