* | (__| |_| | _ <| |___
* \___|\___/|_| \_\_____|
*
- * Copyright (C) 1998 - 2012, Daniel Stenberg, <daniel@haxx.se>, et al.
+ * Copyright (C) 1998 - 2014, Daniel Stenberg, <daniel@haxx.se>, et al.
*
* This software is licensed as described in the file COPYING, which
* you should have received as part of this distribution. The terms
*
***************************************************************************/
-#include "setup.h"
+#include "curl_setup.h"
#ifdef USE_WINDOWS_SSPI
-#ifndef CURL_DISABLE_HTTP
+#if !defined(CURL_DISABLE_HTTP) && defined(USE_HTTP_NEGOTIATE)
#include "urldata.h"
#include "sendf.h"
#include "curl_base64.h"
#include "http_negotiate.h"
#include "curl_memory.h"
+#include "curl_multibyte.h"
#define _MPRINTF_REPLACE /* use our functions only */
#include <curl/mprintf.h>
SecBuffer out_sec_buff;
SecBufferDesc in_buff_desc;
SecBuffer in_sec_buff;
- ULONG context_attributes;
+ unsigned long context_attributes;
TimeStamp lifetime;
-
+ TCHAR *sname;
int ret;
size_t len = 0, input_token_len = 0;
bool gss = FALSE;
const char* protocol;
CURLcode error;
- while(*header && ISSPACE(*header))
- header++;
-
if(checkprefix("GSS-Negotiate", header)) {
protocol = "GSS-Negotiate";
gss = TRUE;
if(!neg_ctx->output_token) {
PSecPkgInfo SecurityPackage;
- ret = s_pSecFn->QuerySecurityPackageInfo((SEC_CHAR *)"Negotiate",
+ ret = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT("Negotiate"),
&SecurityPackage);
if(ret != SEC_E_OK)
return -1;
return -1;
neg_ctx->status =
- s_pSecFn->AcquireCredentialsHandle(NULL, (SEC_CHAR *)"Negotiate",
+ s_pSecFn->AcquireCredentialsHandle(NULL,
+ (TCHAR *) TEXT("Negotiate"),
SECPKG_CRED_OUTBOUND, NULL, NULL,
NULL, NULL, neg_ctx->credentials,
&lifetime);
in_sec_buff.pvBuffer = input_token;
}
+ sname = Curl_convert_UTF8_to_tchar(neg_ctx->server_name);
+ if(!sname)
+ return CURLE_OUT_OF_MEMORY;
+
neg_ctx->status = s_pSecFn->InitializeSecurityContext(
neg_ctx->credentials,
input_token ? neg_ctx->context : 0,
- neg_ctx->server_name,
+ sname,
ISC_REQ_CONFIDENTIALITY,
0,
SECURITY_NATIVE_DREP,
&context_attributes,
&lifetime);
+ Curl_unicodefree(sname);
+
if(GSS_ERROR(neg_ctx->status))
return -1;
cleanup(&data->state.proxyneg);
}
+#endif /* !CURL_DISABLE_HTTP && USE_HTTP_NEGOTIATE */
-#endif
-#endif
+#endif /* USE_WINDOWS_SSPI */