]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
Update the ssltraceref.txt
authorTomas Mraz <tomas@openssl.org>
Thu, 10 Aug 2023 17:04:40 +0000 (19:04 +0200)
committerTomas Mraz <tomas@openssl.org>
Tue, 22 Aug 2023 10:31:46 +0000 (12:31 +0200)
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 <matt@openssl.org>
Reviewed-by: Hugo Landau <hlandau@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/21713)

test/quicapitest.c
test/recipes/75-test_quicapi_data/ssltraceref.txt

index 2e1e8900bed757f8fc85cc5ac1260f43ca044fae..d17d704d29a82a07178d67af6ea743191dcf5694 100644 (file)
@@ -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;
 }
 
index bbb0ae6b3b47a7ee21605e82a47a92b02b36e430..f9e619adfaa3ffb79175fea13af2c11c5ac95642 100644 (file)
@@ -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: <zero length id>
+  Payload length: 1178
+  Token: <zerlo length token>
+  Packet Number: 0x00000001
+Sent Datagram
+  Length: 1200
 Received Datagram
   Length: 234
 Received Packet