summaryrefslogtreecommitdiff
path: root/Utilities/cmcurl/lib/vtls/vtls.c
diff options
context:
space:
mode:
authorBrad King <brad.king@kitware.com>2018-01-24 14:17:42 -0500
committerBrad King <brad.king@kitware.com>2018-01-24 14:18:16 -0500
commitcd8e31a1bf7429514078c2923a1a9580113f9d4f (patch)
tree6a0b8a01e3e0e52bb4b3abb66ce9e992614af6a7 /Utilities/cmcurl/lib/vtls/vtls.c
parente9c8ea75575afdb4e87b262641ee4071ef42b4c6 (diff)
parentaf9e654045f11028e50dac4781e297834129a749 (diff)
downloadcmake-cd8e31a1bf7429514078c2923a1a9580113f9d4f.tar.gz
Merge branch 'upstream-curl' into update-curl
* upstream-curl: curl 2018-01-23 (d6c21c8e)
Diffstat (limited to 'Utilities/cmcurl/lib/vtls/vtls.c')
-rw-r--r--Utilities/cmcurl/lib/vtls/vtls.c25
1 files changed, 21 insertions, 4 deletions
diff --git a/Utilities/cmcurl/lib/vtls/vtls.c b/Utilities/cmcurl/lib/vtls/vtls.c
index bb8fda4196..def1d30cb6 100644
--- a/Utilities/cmcurl/lib/vtls/vtls.c
+++ b/Utilities/cmcurl/lib/vtls/vtls.c
@@ -549,7 +549,7 @@ int Curl_ssl_getsock(struct connectdata *conn,
void Curl_ssl_close(struct connectdata *conn, int sockindex)
{
DEBUGASSERT((sockindex <= 1) && (sockindex >= -1));
- Curl_ssl->close(conn, sockindex);
+ Curl_ssl->close_one(conn, sockindex);
}
CURLcode Curl_ssl_shutdown(struct connectdata *conn, int sockindex)
@@ -1059,6 +1059,7 @@ bool Curl_none_false_start(void)
return FALSE;
}
+#ifndef CURL_DISABLE_CRYPTO_AUTH
CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen,
unsigned char *md5sum, size_t md5len UNUSED_PARAM)
{
@@ -1073,6 +1074,19 @@ CURLcode Curl_none_md5sum(unsigned char *input, size_t inputlen,
Curl_MD5_final(MD5pw, md5sum);
return CURLE_OK;
}
+#else
+CURLcode Curl_none_md5sum(unsigned char *input UNUSED_PARAM,
+ size_t inputlen UNUSED_PARAM,
+ unsigned char *md5sum UNUSED_PARAM,
+ size_t md5len UNUSED_PARAM)
+{
+ (void)input;
+ (void)inputlen;
+ (void)md5sum;
+ (void)md5len;
+ return CURLE_NOT_BUILT_IN;
+}
+#endif
static int Curl_multissl_init(void)
{
@@ -1108,7 +1122,7 @@ static void Curl_multissl_close(struct connectdata *conn, int sockindex)
{
if(multissl_init(NULL))
return;
- Curl_ssl->close(conn, sockindex);
+ Curl_ssl->close_one(conn, sockindex);
}
static const struct Curl_ssl Curl_ssl_multi = {
@@ -1133,7 +1147,7 @@ static const struct Curl_ssl Curl_ssl_multi = {
Curl_multissl_connect, /* connect */
Curl_multissl_connect_nonblocking, /* connect_nonblocking */
Curl_multissl_get_internals, /* get_internals */
- Curl_multissl_close, /* close */
+ Curl_multissl_close, /* close_one */
Curl_none_close_all, /* close_all */
Curl_none_session_free, /* session_free */
Curl_none_set_engine, /* set_engine */
@@ -1246,6 +1260,7 @@ static size_t Curl_multissl_version(char *buffer, size_t size)
static int multissl_init(const struct Curl_ssl *backend)
{
const char *env;
+ char *env_tmp;
int i;
if(Curl_ssl != &Curl_ssl_multi)
@@ -1259,7 +1274,7 @@ static int multissl_init(const struct Curl_ssl *backend)
if(!available_backends[0])
return 1;
- env = getenv("CURL_SSL_BACKEND");
+ env = env_tmp = curl_getenv("CURL_SSL_BACKEND");
#ifdef CURL_DEFAULT_SSL_BACKEND
if(!env)
env = CURL_DEFAULT_SSL_BACKEND;
@@ -1268,6 +1283,7 @@ static int multissl_init(const struct Curl_ssl *backend)
for(i = 0; available_backends[i]; i++) {
if(strcasecompare(env, available_backends[i]->info.name)) {
Curl_ssl = available_backends[i];
+ curl_free(env_tmp);
return 0;
}
}
@@ -1275,6 +1291,7 @@ static int multissl_init(const struct Curl_ssl *backend)
/* Fall back to first available backend */
Curl_ssl = available_backends[0];
+ curl_free(env_tmp);
return 0;
}