summaryrefslogtreecommitdiff
path: root/lib/http_ntlm.c
diff options
context:
space:
mode:
authorSeonah Moon <seonah1.moon@samsung.com>2018-11-08 14:02:01 +0900
committerSeonah Moon <seonah1.moon@samsung.com>2018-11-08 14:02:44 +0900
commitbc9ddd35af69662a667d983e2484f557f76cf230 (patch)
treeb5a226a657e9be62973a1e0c6dedb5adadfc15cf /lib/http_ntlm.c
parentcfd75dcdb18d0a4291f48020211c65507a97d9eb (diff)
downloadcurl-bc9ddd35af69662a667d983e2484f557f76cf230.tar.gz
curl-bc9ddd35af69662a667d983e2484f557f76cf230.tar.bz2
curl-bc9ddd35af69662a667d983e2484f557f76cf230.zip
Imported Upstream version 7.62.0upstream/7.62.0
Change-Id: Ie916d8e445e0cc69e112cee470744a96a9c84799
Diffstat (limited to 'lib/http_ntlm.c')
-rw-r--r--lib/http_ntlm.c16
1 files changed, 13 insertions, 3 deletions
diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c
index 0f1edcf65..a9b33f98e 100644
--- a/lib/http_ntlm.c
+++ b/lib/http_ntlm.c
@@ -121,9 +121,11 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
server, which is for a plain host or for a HTTP proxy */
char **allocuserpwd;
- /* point to the name and password for this */
+ /* point to the username, password, service and host */
const char *userp;
const char *passwdp;
+ const char *service = NULL;
+ const char *hostname = NULL;
/* point to the correct struct with this */
struct ntlmdata *ntlm;
@@ -141,6 +143,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
allocuserpwd = &conn->allocptr.proxyuserpwd;
userp = conn->http_proxy.user;
passwdp = conn->http_proxy.passwd;
+ service = conn->data->set.str[STRING_PROXY_SERVICE_NAME] ?
+ conn->data->set.str[STRING_PROXY_SERVICE_NAME] : "HTTP";
+ hostname = conn->http_proxy.host.name;
ntlm = &conn->proxyntlm;
authp = &conn->data->state.authproxy;
}
@@ -148,6 +153,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
allocuserpwd = &conn->allocptr.userpwd;
userp = conn->user;
passwdp = conn->passwd;
+ service = conn->data->set.str[STRING_SERVICE_NAME] ?
+ conn->data->set.str[STRING_SERVICE_NAME] : "HTTP";
+ hostname = conn->host.name;
ntlm = &conn->ntlm;
authp = &conn->data->state.authhost;
}
@@ -174,7 +182,9 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
default: /* for the weird cases we (re)start here */
/* Create a type-1 message */
result = Curl_auth_create_ntlm_type1_message(conn->data, userp, passwdp,
- ntlm, &base64, &len);
+ service, hostname,
+ ntlm, &base64,
+ &len);
if(result)
return result;
@@ -218,7 +228,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, bool proxy)
/* connection is already authenticated,
* don't send a header in future requests */
ntlm->state = NTLMSTATE_LAST;
- /* fall-through */
+ /* FALLTHROUGH */
case NTLMSTATE_LAST:
Curl_safefree(*allocuserpwd);
authp->done = TRUE;