mirror of
https://github.com/curl/curl.git
synced 2024-11-27 05:50:21 +08:00
ntlm: Renamed handle variables to match other SSPI structures
Code cleanup to try and synchronise code between the different SSPI based authentication mechanisms.
This commit is contained in:
parent
df97ab3e5f
commit
f9f212fb93
@ -344,8 +344,8 @@ void Curl_ntlm_sspi_cleanup(struct ntlmdata *ntlm)
|
|||||||
Curl_safefree(ntlm->input_token);
|
Curl_safefree(ntlm->input_token);
|
||||||
|
|
||||||
if(ntlm->has_handles) {
|
if(ntlm->has_handles) {
|
||||||
s_pSecFn->DeleteSecurityContext(&ntlm->c_handle);
|
s_pSecFn->DeleteSecurityContext(&ntlm->context);
|
||||||
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
|
s_pSecFn->FreeCredentialsHandle(&ntlm->credentials);
|
||||||
ntlm->has_handles = 0;
|
ntlm->has_handles = 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -457,7 +457,7 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
|
|||||||
(TCHAR *) TEXT("NTLM"),
|
(TCHAR *) TEXT("NTLM"),
|
||||||
SECPKG_CRED_OUTBOUND, NULL,
|
SECPKG_CRED_OUTBOUND, NULL,
|
||||||
ntlm->p_identity, NULL, NULL,
|
ntlm->p_identity, NULL, NULL,
|
||||||
&ntlm->handle, &tsDummy);
|
&ntlm->credentials, &tsDummy);
|
||||||
if(status != SEC_E_OK)
|
if(status != SEC_E_OK)
|
||||||
return CURLE_OUT_OF_MEMORY;
|
return CURLE_OUT_OF_MEMORY;
|
||||||
|
|
||||||
@ -470,18 +470,18 @@ CURLcode Curl_ntlm_create_type1_message(const char *userp,
|
|||||||
type_1_buf.cbBuffer = curlx_uztoul(ntlm->max_token_length);
|
type_1_buf.cbBuffer = curlx_uztoul(ntlm->max_token_length);
|
||||||
|
|
||||||
/* Generate our type-1 message */
|
/* Generate our type-1 message */
|
||||||
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle, NULL,
|
status = s_pSecFn->InitializeSecurityContext(&ntlm->credentials, NULL,
|
||||||
(TCHAR *) TEXT(""),
|
(TCHAR *) TEXT(""),
|
||||||
0, 0, SECURITY_NETWORK_DREP,
|
0, 0, SECURITY_NETWORK_DREP,
|
||||||
NULL, 0,
|
NULL, 0,
|
||||||
&ntlm->c_handle, &type_1_desc,
|
&ntlm->context, &type_1_desc,
|
||||||
&attrs, &tsDummy);
|
&attrs, &tsDummy);
|
||||||
|
|
||||||
if(status == SEC_I_COMPLETE_AND_CONTINUE ||
|
if(status == SEC_I_COMPLETE_AND_CONTINUE ||
|
||||||
status == SEC_I_CONTINUE_NEEDED)
|
status == SEC_I_CONTINUE_NEEDED)
|
||||||
s_pSecFn->CompleteAuthToken(&ntlm->c_handle, &type_1_desc);
|
s_pSecFn->CompleteAuthToken(&ntlm->context, &type_1_desc);
|
||||||
else if(status != SEC_E_OK) {
|
else if(status != SEC_E_OK) {
|
||||||
s_pSecFn->FreeCredentialsHandle(&ntlm->handle);
|
s_pSecFn->FreeCredentialsHandle(&ntlm->credentials);
|
||||||
return CURLE_RECV_ERROR;
|
return CURLE_RECV_ERROR;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -652,12 +652,12 @@ CURLcode Curl_ntlm_create_type3_message(struct SessionHandle *data,
|
|||||||
type_3_buf.cbBuffer = curlx_uztoul(ntlm->max_token_length);
|
type_3_buf.cbBuffer = curlx_uztoul(ntlm->max_token_length);
|
||||||
|
|
||||||
/* Generate our type-3 message */
|
/* Generate our type-3 message */
|
||||||
status = s_pSecFn->InitializeSecurityContext(&ntlm->handle,
|
status = s_pSecFn->InitializeSecurityContext(&ntlm->credentials,
|
||||||
&ntlm->c_handle,
|
&ntlm->context,
|
||||||
(TCHAR *) TEXT(""),
|
(TCHAR *) TEXT(""),
|
||||||
0, 0, SECURITY_NETWORK_DREP,
|
0, 0, SECURITY_NETWORK_DREP,
|
||||||
&type_2_desc,
|
&type_2_desc,
|
||||||
0, &ntlm->c_handle,
|
0, &ntlm->context,
|
||||||
&type_3_desc,
|
&type_3_desc,
|
||||||
&attrs, &tsDummy);
|
&attrs, &tsDummy);
|
||||||
if(status != SEC_E_OK) {
|
if(status != SEC_E_OK) {
|
||||||
|
@ -435,8 +435,8 @@ struct kerberos5data {
|
|||||||
struct ntlmdata {
|
struct ntlmdata {
|
||||||
curlntlm state;
|
curlntlm state;
|
||||||
#ifdef USE_WINDOWS_SSPI
|
#ifdef USE_WINDOWS_SSPI
|
||||||
CredHandle handle;
|
CredHandle credentials;
|
||||||
CtxtHandle c_handle;
|
CtxtHandle context;
|
||||||
SEC_WINNT_AUTH_IDENTITY identity;
|
SEC_WINNT_AUTH_IDENTITY identity;
|
||||||
SEC_WINNT_AUTH_IDENTITY *p_identity;
|
SEC_WINNT_AUTH_IDENTITY *p_identity;
|
||||||
size_t max_token_length;
|
size_t max_token_length;
|
||||||
|
Loading…
Reference in New Issue
Block a user