]> git.ipfire.org Git - thirdparty/openssl.git/commitdiff
testutil: increase the line length for reading stanzas
authorPauli <ppzgs1@gmail.com>
Fri, 14 Feb 2025 02:00:59 +0000 (13:00 +1100)
committerPauli <ppzgs1@gmail.com>
Thu, 20 Feb 2025 00:17:39 +0000 (11:17 +1100)
PQC algorithms and SLH-DSA in particular have very long lines of data.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/26750)

test/testutil/stanza.c

index 3fae0b4b347263b47af247e0739978160996d3a4..dc201ffa3ac742070d23e727e3fb6c492119ba3e 100644 (file)
@@ -88,30 +88,31 @@ int test_readstanza(STANZA *s)
     PAIR *pp = s->pairs;
     char *p, *equals, *key;
     const char *value;
+    static char buff[131072];
 
-    for (s->numpairs = 0; BIO_gets(s->fp, s->buff, sizeof(s->buff)); ) {
+    for (s->numpairs = 0; BIO_gets(s->fp, buff, sizeof(buff)); ) {
         s->curr++;
-        if (!TEST_ptr(p = strchr(s->buff, '\n'))) {
+        if (!TEST_ptr(p = strchr(buff, '\n'))) {
             TEST_info("Line %d too long", s->curr);
             return 0;
         }
         *p = '\0';
 
         /* Blank line marks end of tests. */
-        if (s->buff[0] == '\0')
+        if (buff[0] == '\0')
             break;
 
         /* Lines starting with a pound sign are ignored. */
-        if (s->buff[0] == '#')
+        if (buff[0] == '#')
             continue;
 
         /* Parse into key=value */
-        if (!TEST_ptr(equals = strchr(s->buff, '='))) {
+        if (!TEST_ptr(equals = strchr(buff, '='))) {
             TEST_info("Missing = at line %d\n", s->curr);
             return 0;
         }
         *equals++ = '\0';
-        if (!TEST_ptr(key = strip_spaces(s->buff))) {
+        if (!TEST_ptr(key = strip_spaces(buff))) {
             TEST_info("Empty field at line %d\n", s->curr);
             return 0;
         }