Skip to content

Commit

Permalink
Fix VS 2008 build problems
Browse files Browse the repository at this point in the history
  • Loading branch information
georgeok committed Nov 28, 2018
1 parent e135ccc commit 007c2de
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 4 deletions.
4 changes: 3 additions & 1 deletion lib/urldata.h
Expand Up @@ -327,8 +327,10 @@ struct kerberos5data {
#if defined(USE_NTLM)
struct ntlmdata {
curlntlm state;
#ifdef USE_WINDOWS_SSPI
#if defined(USE_WINDOWS_SSPI)
#if defined(_MSC_VER) && (_MSC_VER >= 1600)
CtxtHandle *sslContext;
#endif
CredHandle *credentials;
CtxtHandle *context;
SEC_WINNT_AUTH_IDENTITY identity;
Expand Down
6 changes: 4 additions & 2 deletions lib/vauth/ntlm_sspi.c
Expand Up @@ -270,10 +270,12 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
type_2_bufs[0].pvBuffer = ntlm->input_token;
type_2_bufs[0].cbBuffer = curlx_uztoul(ntlm->input_token_len);

#if defined(USE_WINDOWS_SSPI) && defined(_MSC_VER) && (_MSC_VER >= 1600)
/* ssl context comes from schannel.
* When extended protection is used in IIS server,
* we have to pass a second SecBuffer to the SecBufferDesc
* otherwise ISS will not pass the authentication (401 response)
* otherwise ISS will not pass the authentication (401 response).
* Minimum supported version is Windows 7.
* https://docs.microsoft.com/en-us/security-updates
* /SecurityAdvisories/2009/973811
*/
Expand All @@ -293,7 +295,7 @@ CURLcode Curl_auth_create_ntlm_type3_message(struct Curl_easy *data,
type_2_bufs[1].pvBuffer = pkgBindings.Bindings;
}
}

#endif

/* Setup the type-3 "output" security buffer */
type_3_desc.ulVersion = SECBUFFER_VERSION;
Expand Down
4 changes: 3 additions & 1 deletion lib/vtls/schannel.c
Expand Up @@ -1414,13 +1414,15 @@ schannel_connect_common(struct connectdata *conn, int sockindex,
connssl->state = ssl_connection_complete;
conn->recv[sockindex] = schannel_recv;
conn->send[sockindex] = schannel_send;
#if defined(USE_WINDOWS_SSPI)

#if defined(USE_WINDOWS_SSPI) && defined(_MSC_VER) && (_MSC_VER > 1500)
/* When SSPI is used in combination with scannel
* we need the scannel context to create the channel
* binding to pass the IIS extended protection checks.
*/
conn->ntlm.sslContext = &BACKEND->ctxt->ctxt_handle;
#endif

*done = TRUE;
}
else
Expand Down

0 comments on commit 007c2de

Please sign in to comment.