x509asn1: raise size limit for x509 certification information

Raise the limit for certification information from 10 thousand to 100
thousand bytes. Certificates can be larger than 10k.

Change the infof() debug output to add '...' at the end when the max
limit it can handle is exceeded.

Reported-by: Sergio Durigan Junior
Fixes #14352
Closes #14354
This commit is contained in:
Stefan Eissing 2024-08-02 12:50:07 +02:00 committed by Daniel Stenberg
parent d2abf8dede
commit 39b9ccea8d
No known key found for this signature in database
GPG key ID: 5CC908FDB71E12C2
5 changed files with 21 additions and 18 deletions

View file

@ -119,24 +119,24 @@ fail_unless(verify(result, input) == 0, "No truncation of infof input");
fail_unless(result[sizeof(result) - 1] == '\0',
"No truncation of infof input");
/* Just over the limit for truncation without newline */
/* Just over the limit without newline for truncation via '...' */
memset(input + 2047, 'A', 4);
Curl_infof(data, "%s", input);
fail_unless(strlen(result) == 2048, "Truncation of infof input 1");
fail_unless(strlen(result) == 2051, "Truncation of infof input 1");
fail_unless(result[sizeof(result) - 1] == '\0', "Truncation of infof input 1");
/* Just over the limit for truncation with newline */
/* Just over the limit with newline for truncation via '...' */
memset(input + 2047, 'A', 4);
memset(input + 2047 + 4, '\n', 1);
Curl_infof(data, "%s", input);
fail_unless(strlen(result) == 2048, "Truncation of infof input 2");
fail_unless(strlen(result) == 2051, "Truncation of infof input 2");
fail_unless(result[sizeof(result) - 1] == '\0', "Truncation of infof input 2");
/* Way over the limit for truncation with newline */
/* Way over the limit for truncation via '...' */
memset(input, '\0', sizeof(input));
memset(input, 'A', sizeof(input) - 1);
Curl_infof(data, "%s", input);
fail_unless(strlen(result) == 2048, "Truncation of infof input 3");
fail_unless(strlen(result) == 2051, "Truncation of infof input 3");
fail_unless(result[sizeof(result) - 1] == '\0', "Truncation of infof input 3");