mirror of
https://github.com/curl/curl.git
synced 2026-08-24 13:33:33 +03:00
gnutls: report accurate error when TLS-SRP is not built-in
With GnuTLS 3.8.0+ the build-time SRP feature detection always succeeds. It's also disabled by default in these GnuTLS versions. When using TLS-SRP without it being available in GnuTLS, report the correct error code `CURLE_NOT_BUILT_IN`, replacing the out of memory error reported before this patch. Also add comments to autotools and cmake scripts about this feature detection property. Detecting it at build-time would need to run code which doesn't work in cross-builds. Once curl requires 3.8.0 as minimum, the build-time checks can be deleted. ``` # before: curl: (27) gnutls_srp_allocate_client_cred() failed: An unimplemented or disabled feature has been requested. # after: curl: (4) GnuTLS: TLS-SRP support not built in: An unimplemented or disabled feature has been requested. ``` Ref:dab063fca2Ref:a21e89edacCloses #19365
This commit is contained in:
parent
66a66c596b
commit
8e6149598b
3 changed files with 11 additions and 1 deletions
|
|
@ -877,7 +877,12 @@ static CURLcode gtls_client_init(struct Curl_cfilter *cf,
|
|||
infof(data, "Using TLS-SRP username: %s", config->username);
|
||||
|
||||
rc = gnutls_srp_allocate_client_credentials(>ls->srp_client_cred);
|
||||
if(rc != GNUTLS_E_SUCCESS) {
|
||||
if(rc == GNUTLS_E_UNIMPLEMENTED_FEATURE) {
|
||||
failf(data, "GnuTLS: TLS-SRP support not built in: %s",
|
||||
gnutls_strerror(rc));
|
||||
return CURLE_NOT_BUILT_IN;
|
||||
}
|
||||
else if(rc != GNUTLS_E_SUCCESS) {
|
||||
failf(data, "gnutls_srp_allocate_client_cred() failed: %s",
|
||||
gnutls_strerror(rc));
|
||||
return CURLE_OUT_OF_MEMORY;
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue