From b7278eea441cb70debfbbba350026e58ad41cb83 Mon Sep 17 00:00:00 2001 From: Tomas Mraz Date: Thu, 10 Aug 2023 19:04:40 +0200 Subject: Update the ssltraceref.txt Also adds saving the new trace to ssltraceref-new.txt in test-runs which can be handy when the trace changes and needs to be updated. Reviewed-by: Matt Caswell Reviewed-by: Hugo Landau (Merged from https://github.com/openssl/openssl/pull/21713) --- test/quicapitest.c | 16 +++++++++++++++- test/recipes/75-test_quicapi_data/ssltraceref.txt | 16 ++++++++++++++++ 2 files changed, 31 insertions(+), 1 deletion(-) diff --git a/test/quicapitest.c b/test/quicapitest.c index 2e1e8900be..d17d704d29 100644 --- a/test/quicapitest.c +++ b/test/quicapitest.c @@ -374,7 +374,7 @@ static void strip_line_ends(char *str) static int compare_with_file(BIO *membio) { - BIO *file = NULL; + BIO *file = NULL, *newfile = NULL; char buf1[512], buf2[512]; char *reffile; int ret = 0; @@ -388,6 +388,19 @@ static int compare_with_file(BIO *membio) if (!TEST_ptr(file)) goto err; + newfile = BIO_new_file("ssltraceref-new.txt", "wb"); + if (!TEST_ptr(newfile)) + goto err; + + while (BIO_gets(membio, buf2, sizeof(buf2)) > 0) + if (BIO_puts(newfile, buf2) <= 0) { + TEST_error("Failed writing new file data"); + goto err; + } + + if (!TEST_int_ge(BIO_seek(membio, 0), 0)) + goto err; + while (BIO_gets(file, buf1, sizeof(buf1)) > 0) { if (BIO_gets(membio, buf2, sizeof(buf2)) <= 0) { TEST_error("Failed reading mem data"); @@ -417,6 +430,7 @@ static int compare_with_file(BIO *membio) err: OPENSSL_free(reffile); BIO_free(file); + BIO_free(newfile); return ret; } diff --git a/test/recipes/75-test_quicapi_data/ssltraceref.txt b/test/recipes/75-test_quicapi_data/ssltraceref.txt index bbb0ae6b3b..f9e619adfa 100644 --- a/test/recipes/75-test_quicapi_data/ssltraceref.txt +++ b/test/recipes/75-test_quicapi_data/ssltraceref.txt @@ -233,6 +233,22 @@ YeeuLO02zToHhnQ6KbPXOrQAqcL1kngO4g+j/ru+4AZThFkdkGnltvk= ------------------ No extensions +Sent Frame: Ack (without ECN) + Largest acked: 0 + Ack delay (raw) 0 + Ack range count: 0 + First ack range: 0 +Sent Frame: Padding +Sent Packet + Packet Type: Initial + Version: 0x00000001 + Destination Conn Id: 0x???????????????? + Source Conn Id: + Payload length: 1178 + Token: + Packet Number: 0x00000001 +Sent Datagram + Length: 1200 Received Datagram Length: 234 Received Packet -- cgit v1.2.3