diff options
author | Stefan Bühler <buehler@teamviewer.com> | 2015-11-12 11:09:21 +0100 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2015-11-12 19:11:40 +0000 |
commit | b6baa108fac4d5c251fd4951867444d7cb92fe96 (patch) | |
tree | c7f8a7d2a3a932f4e8a6befe5a29beee4e97c46b | |
parent | 88702ebb315a10a12f9cd1f3f0ffdaacc79adfb0 (diff) |
sasl_sspi: fixed unicode build for digest authentication
Closes #525
-rw-r--r-- | lib/curl_sasl_sspi.c | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/lib/curl_sasl_sspi.c b/lib/curl_sasl_sspi.c index 3e2e49571..84fce9f24 100644 --- a/lib/curl_sasl_sspi.c +++ b/lib/curl_sasl_sspi.c @@ -418,6 +418,7 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, SECURITY_STATUS status; unsigned long attrs; TimeStamp expiry; /* For Windows 9x compatibility of SSPI calls */ + TCHAR *spn; (void) data; @@ -489,12 +490,20 @@ CURLcode Curl_sasl_create_digest_http_message(struct SessionHandle *data, resp_buf.pvBuffer = output_token; resp_buf.cbBuffer = curlx_uztoul(token_max); + spn = Curl_convert_UTF8_to_tchar((char *) uripath); + if(!spn) { + free(output_token); + + return CURLE_OUT_OF_MEMORY; + } + /* Generate our reponse message */ status = s_pSecFn->InitializeSecurityContext(&credentials, NULL, - (TCHAR *) uripath, + spn, ISC_REQ_USE_HTTP_STYLE, 0, 0, &chlg_desc, 0, &context, &resp_desc, &attrs, &expiry); + Curl_unicodefree(spn); if(status == SEC_I_COMPLETE_NEEDED || status == SEC_I_COMPLETE_AND_CONTINUE) |