diff options
author | toughengineer <paul.skeptic@yandex.ru> | 2017-07-08 02:10:08 +0200 |
---|---|---|
committer | Marcel Raad <Marcel.Raad@teamviewer.com> | 2018-04-16 20:43:21 +0200 |
commit | bc4b8c9717c8972acf1f8d6383b127b5c8ef3e72 (patch) | |
tree | 2fd661d5a829e90e76c47727c235ccf9a4d76c0e /lib/vauth/ntlm.c | |
parent | 2d4c2152c9eb3dbdf943de46ed8fc11285f1b90b (diff) |
ntlm_sspi: fix authentication using Credential Manager
If you pass empty user/pass asking curl to use Windows Credential
Storage (as stated in the docs) and it has valid credentials for the
domain, e.g.
curl -v -u : --ntlm example.com
currently authentication fails.
This change fixes it by providing proper SPN string to the SSPI API
calls.
Fixes https://github.com/curl/curl/issues/1622
Closes https://github.com/curl/curl/pull/1660
Diffstat (limited to 'lib/vauth/ntlm.c')
-rw-r--r-- | lib/vauth/ntlm.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/lib/vauth/ntlm.c b/lib/vauth/ntlm.c index 1e0d4792e..ea5e56e37 100644 --- a/lib/vauth/ntlm.c +++ b/lib/vauth/ntlm.c @@ -355,6 +355,8 @@ static void unicodecpy(unsigned char *dest, const char *src, size_t length) * data [in] - The session handle. * userp [in] - The user name in the format User or Domain\User. * passdwp [in] - The user's password. + * service [in] - The service type such as http, smtp, pop or imap. + * host [in] - The host name. * ntlm [in/out] - The NTLM data struct being used and modified. * outptr [in/out] - The address where a pointer to newly allocated memory * holding the result will be stored upon completion. @@ -365,6 +367,8 @@ static void unicodecpy(unsigned char *dest, const char *src, size_t length) CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, const char *userp, const char *passwdp, + const char *service, + const char *hostname, struct ntlmdata *ntlm, char **outptr, size_t *outlen) { @@ -394,6 +398,8 @@ CURLcode Curl_auth_create_ntlm_type1_message(struct Curl_easy *data, domain are empty */ (void)userp; (void)passwdp; + (void)service, + (void)hostname, /* Clean up any former leftovers and initialise to defaults */ Curl_auth_ntlm_cleanup(ntlm); |