@@ -2843,52 +2843,33 @@ CURLcode Curl_vsetopt(struct Curl_easy *data, CURLoption option, va_list param)
2843
2843
case CURLOPT_TLSAUTH_USERNAME :
2844
2844
result = Curl_setstropt (& data -> set .str [STRING_TLSAUTH_USERNAME ],
2845
2845
va_arg (param , char * ));
2846
- if (data -> set .str [STRING_TLSAUTH_USERNAME ] &&
2847
- !data -> set .ssl .primary .authtype )
2848
- data -> set .ssl .primary .authtype = CURL_TLSAUTH_SRP ; /* default to SRP */
2849
2846
break ;
2850
2847
#ifndef CURL_DISABLE_PROXY
2851
2848
case CURLOPT_PROXY_TLSAUTH_USERNAME :
2852
2849
result = Curl_setstropt (& data -> set .str [STRING_TLSAUTH_USERNAME_PROXY ],
2853
2850
va_arg (param , char * ));
2854
- if (data -> set .str [STRING_TLSAUTH_USERNAME_PROXY ] &&
2855
- !data -> set .proxy_ssl .primary .authtype )
2856
- data -> set .proxy_ssl .primary .authtype = CURL_TLSAUTH_SRP ; /* default to
2857
- SRP */
2858
2851
break ;
2859
2852
#endif
2860
2853
case CURLOPT_TLSAUTH_PASSWORD :
2861
2854
result = Curl_setstropt (& data -> set .str [STRING_TLSAUTH_PASSWORD ],
2862
2855
va_arg (param , char * ));
2863
- if (data -> set .str [STRING_TLSAUTH_USERNAME ] &&
2864
- !data -> set .ssl .primary .authtype )
2865
- data -> set .ssl .primary .authtype = CURL_TLSAUTH_SRP ; /* default */
2866
2856
break ;
2867
2857
#ifndef CURL_DISABLE_PROXY
2868
2858
case CURLOPT_PROXY_TLSAUTH_PASSWORD :
2869
2859
result = Curl_setstropt (& data -> set .str [STRING_TLSAUTH_PASSWORD_PROXY ],
2870
2860
va_arg (param , char * ));
2871
- if (data -> set .str [STRING_TLSAUTH_USERNAME_PROXY ] &&
2872
- !data -> set .proxy_ssl .primary .authtype )
2873
- data -> set .proxy_ssl .primary .authtype = CURL_TLSAUTH_SRP ; /* default */
2874
2861
break ;
2875
2862
#endif
2876
2863
case CURLOPT_TLSAUTH_TYPE :
2877
2864
argptr = va_arg (param , char * );
2878
- if (!argptr ||
2879
- strncasecompare (argptr , "SRP" , strlen ("SRP" )))
2880
- data -> set .ssl .primary .authtype = CURL_TLSAUTH_SRP ;
2881
- else
2882
- data -> set .ssl .primary .authtype = CURL_TLSAUTH_NONE ;
2865
+ if (argptr && !strncasecompare (argptr , "SRP" , strlen ("SRP" )))
2866
+ return CURLE_BAD_FUNCTION_ARGUMENT ;
2883
2867
break ;
2884
2868
#ifndef CURL_DISABLE_PROXY
2885
2869
case CURLOPT_PROXY_TLSAUTH_TYPE :
2886
2870
argptr = va_arg (param , char * );
2887
- if (!argptr ||
2888
- strncasecompare (argptr , "SRP" , strlen ("SRP" )))
2889
- data -> set .proxy_ssl .primary .authtype = CURL_TLSAUTH_SRP ;
2890
- else
2891
- data -> set .proxy_ssl .primary .authtype = CURL_TLSAUTH_NONE ;
2871
+ if (argptr || !strncasecompare (argptr , "SRP" , strlen ("SRP" )))
2872
+ return CURLE_BAD_FUNCTION_ARGUMENT ;
2892
2873
break ;
2893
2874
#endif
2894
2875
#endif
0 commit comments