1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-21 15:48:49 -05:00

vtls: select ssl backend case-insensitive (follow-up)

- Do a case-insensitive comparison of CURL_SSL_BACKEND env as well.

- Change Curl_strcasecompare calls to strcasecompare
  (maps to the former but shorter).

Follow-up to c290b8f.

Bug: https://github.com/curl/curl/commit/c290b8f#commitcomment-24094313

Co-authored-by: Jay Satiro
This commit is contained in:
Gisle Vanem 2017-09-06 02:22:49 -04:00 committed by Jay Satiro
parent 6cdba64e13
commit 61825be02b
2 changed files with 10 additions and 7 deletions

View File

@ -352,8 +352,8 @@ CURLcode Curl_auth_decode_digest_http_message(const char *chlg,
if(!Curl_auth_digest_get_pair(p, value, content, &p)) if(!Curl_auth_digest_get_pair(p, value, content, &p))
break; break;
if(Curl_strcasecompare(value, "stale") if(strcasecompare(value, "stale") &&
&& Curl_strcasecompare(content, "true")) { strcasecompare(content, "true")) {
stale = true; stale = true;
break; break;
} }

View File

@ -1250,12 +1250,14 @@ static int multissl_init(const struct Curl_ssl *backend)
if(!env) if(!env)
env = CURL_DEFAULT_SSL_BACKEND; env = CURL_DEFAULT_SSL_BACKEND;
#endif #endif
if(env) if(env) {
for(i = 0; available_backends[i]; i++) for(i = 0; available_backends[i]; i++) {
if(!strcmp(env, available_backends[i]->info.name)) { if(strcasecompare(env, available_backends[i]->info.name)) {
Curl_ssl = available_backends[i]; Curl_ssl = available_backends[i];
return 0; return 0;
} }
}
}
/* Fall back to first available backend */ /* Fall back to first available backend */
Curl_ssl = available_backends[0]; Curl_ssl = available_backends[0];
@ -1270,12 +1272,13 @@ CURLsslset curl_global_sslset(curl_sslbackend id, const char *name,
if(Curl_ssl != &Curl_ssl_multi) if(Curl_ssl != &Curl_ssl_multi)
return id == Curl_ssl->info.id ? CURLSSLSET_OK : CURLSSLSET_TOO_LATE; return id == Curl_ssl->info.id ? CURLSSLSET_OK : CURLSSLSET_TOO_LATE;
for(i = 0; available_backends[i]; i++) for(i = 0; available_backends[i]; i++) {
if(available_backends[i]->info.id == id || if(available_backends[i]->info.id == id ||
(name && Curl_strcasecompare(available_backends[i]->info.name, name))) { (name && strcasecompare(available_backends[i]->info.name, name))) {
multissl_init(available_backends[i]); multissl_init(available_backends[i]);
return CURLSSLSET_OK; return CURLSSLSET_OK;
} }
}
if(avail) if(avail)
*avail = (const curl_ssl_backend **)&available_backends; *avail = (const curl_ssl_backend **)&available_backends;