Commit 2ede1370 authored by Rob Shearman's avatar Rob Shearman Committed by Alexandre Julliard

secur32: Don't free the password in InitializeSecurityContextW to enable the…

secur32: Don't free the password in InitializeSecurityContextW to enable the credentials handle to be re-used in further InitializeSecurityContextW calls.
parent f438e524
......@@ -524,12 +524,7 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
if((ret = encodeBase64((unsigned char*)helper->password,
helper->pwlen, buffer+3,
max_len-3, &buffer_len)) != SEC_E_OK)
{
TRACE("Deleting password!\n");
memset(helper->password, 0, helper->pwlen);
HeapFree(GetProcessHeap(), 0, helper->password);
goto isc_end;
}
}
......@@ -770,13 +765,6 @@ static SECURITY_STATUS SEC_ENTRY ntlm_InitializeSecurityContextW(
helper->crypt.ntlm2.recv_seq_no = 0l;
}
if(ret != SEC_I_CONTINUE_NEEDED)
{
TRACE("Deleting password!\n");
if(helper->password)
memset(helper->password, 0, helper->pwlen);
HeapFree(GetProcessHeap(), 0, helper->password);
}
isc_end:
HeapFree(GetProcessHeap(), 0, want_flags);
HeapFree(GetProcessHeap(), 0, buffer);
......@@ -1515,6 +1503,9 @@ static SECURITY_STATUS SEC_ENTRY ntlm_FreeCredentialsHandle(
PNegoHelper helper = (PNegoHelper) phCredential->dwLower;
phCredential->dwUpper = 0;
phCredential->dwLower = 0;
if (helper->password)
memset(helper->password, 0, helper->pwlen);
HeapFree(GetProcessHeap(), 0, helper->password);
cleanup_helper(helper);
ret = SEC_E_OK;
}
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment