summaryrefslogtreecommitdiff
path: root/lib/http_digest.c
diff options
context:
space:
mode:
authorSteve Holme <steve_holme@hotmail.com>2014-11-05 13:58:24 +0000
committerSteve Holme <steve_holme@hotmail.com>2014-11-05 13:51:11 +0000
commit25264131e266c50fe521a448016251fef8b23273 (patch)
tree936702fa4fa1b0e826ec2edf24a677762e636793 /lib/http_digest.c
parentd7bfce3951087eaa1d6a41f2e9f50a4b2180c5a2 (diff)
downloadcurl-25264131e266c50fe521a448016251fef8b23273.tar.gz
http_digest: Moved clean-up function into SASL module
Diffstat (limited to 'lib/http_digest.c')
-rw-r--r--lib/http_digest.c23
1 files changed, 3 insertions, 20 deletions
diff --git a/lib/http_digest.c b/lib/http_digest.c
index 1d42769c5..d2dbfe59b 100644
--- a/lib/http_digest.c
+++ b/lib/http_digest.c
@@ -45,8 +45,6 @@
#define MAX_VALUE_LENGTH 256
#define MAX_CONTENT_LENGTH 1024
-static void digest_cleanup_one(struct digestdata *dig);
-
/*
* Return 0 on success and then the buffers are filled in fine.
*
@@ -150,7 +148,7 @@ CURLcode Curl_input_digest(struct connectdata *conn,
before = TRUE;
/* clear off any former leftovers and init to defaults */
- digest_cleanup_one(d);
+ Curl_sasl_digest_cleanup(d);
for(;;) {
char value[MAX_VALUE_LENGTH];
@@ -579,25 +577,10 @@ CURLcode Curl_output_digest(struct connectdata *conn,
return CURLE_OK;
}
-static void digest_cleanup_one(struct digestdata *d)
-{
- Curl_safefree(d->nonce);
- Curl_safefree(d->cnonce);
- Curl_safefree(d->realm);
- Curl_safefree(d->opaque);
- Curl_safefree(d->qop);
- Curl_safefree(d->algorithm);
-
- d->nc = 0;
- d->algo = CURLDIGESTALGO_MD5; /* default algorithm */
- d->stale = FALSE; /* default means normal, not stale */
-}
-
-
void Curl_digest_cleanup(struct SessionHandle *data)
{
- digest_cleanup_one(&data->state.digest);
- digest_cleanup_one(&data->state.proxydigest);
+ Curl_sasl_digest_cleanup(&data->state.digest);
+ Curl_sasl_digest_cleanup(&data->state.proxydigest);
}
#endif