aboutsummaryrefslogtreecommitdiff
path: root/lib/curl_sasl_sspi.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-10-09 11:03:14 +0100
committerSteve Holme <steve_holme@hotmail.com>2014-11-09 11:10:34 +0000
commit474442dd564cab52d7732403eba5cd630764ba26 (patch)
tree0e69519916a2b96c6b1fef8badd03263bdfd2d68 /lib/curl_sasl_sspi.c
parent79931c5aebd86ad561a98a461b2fefed30e54ad8 (diff)
ntlm: Moved SSPI clean-up code into SASL module
Diffstat (limited to 'lib/curl_sasl_sspi.c')
-rw-r--r--lib/curl_sasl_sspi.c40
1 files changed, 40 insertions, 0 deletions
diff --git a/lib/curl_sasl_sspi.c b/lib/curl_sasl_sspi.c
index 44f909f21..de247cc2c 100644
--- a/lib/curl_sasl_sspi.c
+++ b/lib/curl_sasl_sspi.c
@@ -485,6 +485,46 @@ void Curl_sasl_digest_cleanup(struct digestdata *digest)
}
#endif /* !CURL_DISABLE_CRYPTO_AUTH */
+#if defined USE_NTLM
+/*
+ * Curl_sasl_ntlm_cleanup()
+ *
+ * This is used to clean up the ntlm specific data.
+ *
+ * Parameters:
+ *
+ * ntlm [in/out] - The ntlm data struct being cleaned up.
+ *
+ */
+void Curl_sasl_ntlm_cleanup(struct ntlmdata *ntlm)
+{
+ /* Free our security context */
+ if(ntlm->context) {
+ s_pSecFn->DeleteSecurityContext(ntlm->context);
+ free(ntlm->context);
+ ntlm->context = NULL;
+ }
+
+ /* Free our credentials handle */
+ if(ntlm->credentials) {
+ s_pSecFn->FreeCredentialsHandle(ntlm->credentials);
+ free(ntlm->credentials);
+ ntlm->credentials = NULL;
+ }
+
+ /* Free our identity */
+ Curl_sspi_free_identity(ntlm->p_identity);
+ ntlm->p_identity = NULL;
+
+ /* Free the input and output tokens */
+ Curl_safefree(ntlm->input_token);
+ Curl_safefree(ntlm->output_token);
+
+ /* Reset any variables */
+ ntlm->token_max = 0;
+}
+#endif /* USE_NTLM */
+
#if defined(USE_KRB5)
/*
* Curl_sasl_create_gssapi_user_message()