From: Pauli Date: Fri, 14 Feb 2025 02:00:59 +0000 (+1100) Subject: testutil: increase the line length for reading stanzas X-Git-Tag: openssl-3.5.0-alpha1~153 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=4439b8d3cc5c9a224884c17984d43efc29225e3f;p=thirdparty%2Fopenssl.git testutil: increase the line length for reading stanzas PQC algorithms and SLH-DSA in particular have very long lines of data. Reviewed-by: Tim Hudson Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/26750) --- diff --git a/test/testutil/stanza.c b/test/testutil/stanza.c index 3fae0b4b347..dc201ffa3ac 100644 --- a/test/testutil/stanza.c +++ b/test/testutil/stanza.c @@ -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; }