summaryrefslogtreecommitdiff
path: root/daemon/digest.c
diff options
context:
space:
mode:
authorStef Walter <stef@memberwebs.com>2008-06-11 22:03:08 +0000
committerStef Walter <stef@memberwebs.com>2008-06-11 22:03:08 +0000
commitde44fe7893da8d8c9903f1a7268fa6fe03446d36 (patch)
treed551e17b64d6bef889179b32ab1bdd991e3c0fbf /daemon/digest.c
parent0cb3f6098d959479a96c26a92d91becc2110b30d (diff)
Allow better migration of live digest sessions between httpauth
daemons by using the 'stale' flag when things seem out of date.
Diffstat (limited to 'daemon/digest.c')
-rw-r--r--daemon/digest.c9
1 files changed, 6 insertions, 3 deletions
diff --git a/daemon/digest.c b/daemon/digest.c
index 21cb453..93f433b 100644
--- a/daemon/digest.c
+++ b/daemon/digest.c
@@ -242,20 +242,22 @@ int digest_parse(const char* head, ha_buffer_t* buf, digest_header_t* rec)
return HA_OK;
}
-int digest_check(digest_context_t* dg, const ha_context_t* opts, ha_buffer_t* buf)
+int digest_check(digest_context_t* dg, const ha_context_t* opts, ha_buffer_t* buf, int *stale)
{
int r;
- r = digest_pre_check(dg, opts, buf);
+ r = digest_pre_check(dg, opts, buf, stale);
if(r == HA_OK)
r = digest_complete_check(dg, opts, buf);
return r;
}
-int digest_pre_check(digest_context_t* dg, const ha_context_t* opts, ha_buffer_t* buf)
+int digest_pre_check(digest_context_t* dg, const ha_context_t* opts,
+ ha_buffer_t* buf, int *stale)
{
ASSERT(buf && buf && dg);
+ ASSERT(stale);
/* Check for digest */
if(!dg->client.digest || !dg->client.digest[0])
@@ -337,6 +339,7 @@ int digest_pre_check(digest_context_t* dg, const ha_context_t* opts, ha_buffer_t
ha_messagex(NULL, LOG_WARNING, "digest response has wrong nc value: %s "
"possible replay attack, should be: %d",
dg->client.nc, dg->server_nc);
+ *stale = 1;
return HA_FALSE;
}
}