diff options
author | Steve Holme <steve_holme@hotmail.com> | 2014-11-05 13:58:24 +0000 |
---|---|---|
committer | Steve Holme <steve_holme@hotmail.com> | 2014-11-05 13:51:11 +0000 |
commit | 25264131e266c50fe521a448016251fef8b23273 (patch) | |
tree | 936702fa4fa1b0e826ec2edf24a677762e636793 /lib/curl_sasl.c | |
parent | d7bfce3951087eaa1d6a41f2e9f50a4b2180c5a2 (diff) |
http_digest: Moved clean-up function into SASL module
Diffstat (limited to 'lib/curl_sasl.c')
-rw-r--r-- | lib/curl_sasl.c | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/lib/curl_sasl.c b/lib/curl_sasl.c index 3bf973d95..ebb8d8153 100644 --- a/lib/curl_sasl.c +++ b/lib/curl_sasl.c @@ -582,6 +582,29 @@ CURLcode Curl_sasl_create_digest_md5_message(struct SessionHandle *data, } #endif /* !USE_WINDOWS_SSPI */ +/* + * Curl_sasl_digest_cleanup() + * + * This is used to clean up the digest specific data. + * + * Parameters: + * + * digest [in/out] - The digest data struct being cleaned up. + * + */ +void Curl_sasl_digest_cleanup(struct digestdata *digest) +{ + Curl_safefree(digest->nonce); + Curl_safefree(digest->cnonce); + Curl_safefree(digest->realm); + Curl_safefree(digest->opaque); + Curl_safefree(digest->qop); + Curl_safefree(digest->algorithm); + + digest->nc = 0; + digest->algo = CURLDIGESTALGO_MD5; /* default algorithm */ + digest->stale = FALSE; /* default means normal, not stale */ +} #endif /* CURL_DISABLE_CRYPTO_AUTH */ #ifdef USE_NTLM |