1
0
mirror of https://github.com/moparisthebest/curl synced 2024-12-22 08:08:50 -05:00

ntlm: Added support for SSPI package info query

Just as with the SSPI implementations of Digest and Negotiate added a
package info query so that libcurl can a) return a more appropriate
error code when the NTLM package is not supported and b) it can be of
use later to allocate a dynamic buffer for the Type-1 and Type-3
output tokens rather than use a fixed buffer of 1024 bytes.
This commit is contained in:
Steve Holme 2014-08-07 20:07:46 +01:00
parent dc61480c54
commit 03d34b683d

View File

@ -414,6 +414,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
#ifdef USE_WINDOWS_SSPI
PSecPkgInfo SecurityPackage;
SecBuffer type_1_buf;
SecBufferDesc type_1_desc;
SECURITY_STATUS status;
@ -422,6 +423,15 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
Curl_ntlm_sspi_cleanup(ntlm);
/* Query the security package for NTLM */
status = s_pSecFn->QuerySecurityPackageInfo((TCHAR *) TEXT("NTLM"),
&SecurityPackage);
if(status != SEC_E_OK)
return CURLE_NOT_BUILT_IN;
/* Release the package buffer as it is not required anymore */
s_pSecFn->FreeContextBuffer(SecurityPackage);
if(userp && *userp) {
CURLcode result;