diff options
author | Daniel Stenberg <daniel@haxx.se> | 2005-09-19 21:45:16 +0000 |
---|---|---|
committer | Daniel Stenberg <daniel@haxx.se> | 2005-09-19 21:45:16 +0000 |
commit | 3fe531196771c8e81f917eebca4a06e062ab3a19 (patch) | |
tree | 2ffc1f10a46b700f4cbb33f199c040ec3df1beac /lib/http_ntlm.c | |
parent | 6a48639c6820098604e79bbb2a2cb5effc2da8c0 (diff) |
Dmitry Bartsevich made the SSPI support work on Windows 9x as well
Diffstat (limited to 'lib/http_ntlm.c')
-rw-r--r-- | lib/http_ntlm.c | 24 |
1 files changed, 18 insertions, 6 deletions
diff --git a/lib/http_ntlm.c b/lib/http_ntlm.c index 835acdeb8..e6935e65f 100644 --- a/lib/http_ntlm.c +++ b/lib/http_ntlm.c @@ -387,6 +387,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, ULONG attrs; const char *user; int domlen; + TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */ ntlm_sspi_cleanup(ntlm); @@ -430,8 +431,8 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, if (AcquireCredentialsHandle( NULL, (char *)"NTLM", SECPKG_CRED_OUTBOUND, NULL, ntlm->p_identity, - NULL, NULL, &ntlm->handle, NULL - ) != SEC_E_OK) { + NULL, NULL, &ntlm->handle, &tsDummy + ) != SEC_E_OK) { return CURLE_OUT_OF_MEMORY; } @@ -447,12 +448,22 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, ISC_REQ_REPLAY_DETECT | ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, NULL, 0, - &ntlm->c_handle, &desc, &attrs, NULL - ); + &ntlm->c_handle, &desc, &attrs, &tsDummy + ); if (status == SEC_I_COMPLETE_AND_CONTINUE || status == SEC_I_CONTINUE_NEEDED) { - CompleteAuthToken(&ntlm->c_handle, &desc); + /* CompleteAuthToken() is not present in Win9x, so load it dynamically */ + SECURITY_STATUS (SEC_ENTRY * pCompleteAuthToken) + (PCtxtHandle,PSecBufferDesc); + HMODULE hSecur32 = GetModuleHandle("secur32.dll"); + if (hSecur32 != NULL) { + *((void**)&pCompleteAuthToken) = + (void*)GetProcAddress(hSecur32, "CompleteAuthToken"); + if( pCompleteAuthToken != NULL ) { + pCompleteAuthToken(&ntlm->c_handle, &desc); + } + } } else if (status != SEC_E_OK) { FreeCredentialsHandle(&ntlm->handle); @@ -553,6 +564,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, SecBufferDesc type_2_desc, type_3_desc; SECURITY_STATUS status; ULONG attrs; + TimeStamp tsDummy; /* For Windows 9x compatibility of SPPI calls */ type_2_desc.ulVersion = type_3_desc.ulVersion = SECBUFFER_VERSION; type_2_desc.cBuffers = type_3_desc.cBuffers = 1; @@ -573,7 +585,7 @@ CURLcode Curl_output_ntlm(struct connectdata *conn, ISC_REQ_CONNECTION, 0, SECURITY_NETWORK_DREP, &type_2_desc, 0, &ntlm->c_handle, &type_3_desc, - &attrs, NULL); + &attrs, &tsDummy); if (status != SEC_E_OK) return CURLE_RECV_ERROR; |