mirror of
https://github.com/curl/curl.git
synced 2026-07-27 23:23:07 +03:00
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:
parent
d2abf8dede
commit
39b9ccea8d
5 changed files with 21 additions and 18 deletions
|
|
@ -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");
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue