setopt: fix check for CURLOPT_PROXY_TLSAUTH_TYPE value

Prior to this change CURLOPT_PROXY_TLSAUTH_TYPE would return
CURLE_BAD_FUNCTION_ARGUMENT on any type other than NULL. Since there is
only one type of TLS auth and it is also the default (SRP) the TLS auth
would work anyway.

Closes https://github.com/curl/curl/pull/12981
This commit is contained in:
Scott Talbert 2024-02-23 22:02:09 -05:00 committed by Jay Satiro
parent e3a3bb371f
commit 7448054c38

View File

@ -2864,13 +2864,13 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
#endif
case CURLOPT_TLSAUTH_TYPE:
argptr = va_arg(param, char *);
if(argptr && !strncasecompare(argptr, "SRP", strlen("SRP")))
if(argptr && !strcasecompare(argptr, "SRP"))
return CURLE_BAD_FUNCTION_ARGUMENT;
break;
#ifndef CURL_DISABLE_PROXY
case CURLOPT_PROXY_TLSAUTH_TYPE:
argptr = va_arg(param, char *);
if(argptr || !strncasecompare(argptr, "SRP", strlen("SRP")))
if(argptr && !strcasecompare(argptr, "SRP"))
return CURLE_BAD_FUNCTION_ARGUMENT;
break;
#endif