Repository navigation
GnuTLS certificates can be bigger than MAX_X509_CERT #14352
Copy link
Copy link
Closed
Description
Activity
After some investigation, I noticed that the problem is happening on
Curl_extract_certinfo. Specifically, the following excerpts:Line 1096 in 45246eb
Curl_dyn_init(&out, MAX_X509_STR); Lines 1235 to 1252 in 45246eb
result = Curl_dyn_add(&out, "-----BEGIN CERTIFICATE-----\n"); if(!result) { size_t j = 0; while(!result && (j < clen)) { size_t chunksize = (clen - j) > 64 ? 64 : (clen - j); result = Curl_dyn_addn(&out, &certptr[j], chunksize); if(!result) result = Curl_dyn_addn(&out, "\n", 1); j += chunksize; } if(!result) result = Curl_dyn_add(&out, "-----END CERTIFICATE-----\n"); } free(certptr); if(!result) if(data->set.ssl.certinfo) result = ssl_push_certinfo_dyn(data, certnum, "Cert", &out); The certificate we get from the website has a size that's much bigger than
MAX_X509_STR.- added a commit that references this issue
on Aug 2, 2024 Can reproduce. Analyzing the cause.
- added a commit that references this issue
on Aug 2, 2024 I propose #14354 as fix for this. Could you verify?
- added a commit that references this issue
on Aug 2, 2024
Metadata
Metadata
Assignees
Labels
No labels
I did this
We've received the following bug in Debian:
https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1076800
We are linking curl against GnuTLS, and the following error started happening:
I expected the following
When using curl linked against OpenSSL, I see:
The output above has been truncated for readability.
curl/libcurl version
curl 8.9.1
operating system
Debian unstable