summaryrefslogtreecommitdiffstats
path: root/test
diff options
context:
space:
mode:
authorTomas Mraz <tomas@openssl.org>2023-06-12 18:16:35 +0200
committerTomas Mraz <tomas@openssl.org>2023-06-23 14:31:45 +0200
commita02571a02473889d13fe7996e0d2d052328f3199 (patch)
tree75640dea8f81108e88292cfbb8b4b26e066da959 /test
parentff88545e02ab48a52952350c52013cf765455dd3 (diff)
Support SSL_OP_CLEANSE_PLAINTEXT on QUIC streams
Reviewed-by: Paul Dale <pauli@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org> (Merged from https://github.com/openssl/openssl/pull/21182)
Diffstat (limited to 'test')
-rw-r--r--test/quic_stream_test.c15
1 files changed, 12 insertions, 3 deletions
diff --git a/test/quic_stream_test.c b/test/quic_stream_test.c
index e7690ff20f..04882b21f0 100644
--- a/test/quic_stream_test.c
+++ b/test/quic_stream_test.c
@@ -469,6 +469,9 @@ static int test_rstream_random(int idx)
|| !TEST_ptr(rstream = ossl_quic_rstream_new(NULL, NULL, 0)))
goto err;
+ if (idx % 3 == 0)
+ ossl_quic_rstream_set_cleanse(rstream, 1);
+
for (i = 0; i < data_size; ++i)
bulk_data[i] = (unsigned char)(test_random() & 0xFF);
@@ -522,8 +525,9 @@ static int test_rstream_random(int idx)
}
if (!TEST_size_t_ge(readbytes, queued_min - read_off)
|| !TEST_size_t_le(readbytes + read_off, data_size)
- || !TEST_mem_eq(read_buf, readbytes, bulk_data + read_off,
- readbytes))
+ || (idx % 3 != 0
+ && !TEST_mem_eq(read_buf, readbytes, bulk_data + read_off,
+ readbytes)))
goto err;
read_off += readbytes;
queued_min = read_off;
@@ -543,6 +547,11 @@ static int test_rstream_random(int idx)
TEST_info("Total read bytes: %zu Fin rcvd: %d", read_off, fin);
+ if (idx % 3 == 0)
+ for (i = 0; i < read_off; i++)
+ if (!TEST_uchar_eq(bulk_data[i], 0))
+ goto err;
+
if (read_off == data_size && fin_set && !fin) {
/* We might still receive the final empty frame */
if (idx % 2 == 0) {
@@ -561,9 +570,9 @@ static int test_rstream_random(int idx)
ret = 1;
err:
+ ossl_quic_rstream_free(rstream);
OPENSSL_free(bulk_data);
OPENSSL_free(read_buf);
- ossl_quic_rstream_free(rstream);
return ret;
}