Module: sip-router
Branch: master
Commit: 010f9159f974d81d8bf5be2ab4d92e38325de884
URL:
http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=010f915…
Author: Daniel-Constantin Mierla <miconda(a)gmail.com>
Committer: Daniel-Constantin Mierla <miconda(a)gmail.com>
Date: Sun Dec 5 23:25:41 2010 +0100
auth_db(k): more granular return codes for failure cases
- enhanced the config auth functions return codes
- part of a path by Alex Hermann, FS#101
---
modules_k/auth_db/authorize.c | 12 ++++++++++++
1 files changed, 12 insertions(+), 0 deletions(-)
diff --git a/modules_k/auth_db/authorize.c b/modules_k/auth_db/authorize.c
index 564da9c..0502760 100644
--- a/modules_k/auth_db/authorize.c
+++ b/modules_k/auth_db/authorize.c
@@ -220,6 +220,18 @@ static int digest_authenticate(struct sip_msg* msg, str *realm,
ret = auth_api.pre_auth(msg, realm, hftype, &h, NULL);
switch(ret) {
+ case NONCE_REUSED:
+ LM_DBG("nonce reused");
+ ret = AUTH_NONCE_REUSED;
+ goto end;
+ case STALE_NONCE:
+ LM_DBG("stale nonce\n");
+ ret = AUTH_STALE_NONCE;
+ goto end;
+ case NO_CREDENTIALS:
+ LM_DBG("no credentials\n");
+ ret = AUTH_NO_CREDENTIALS;
+ goto end;
case ERROR:
case BAD_CREDENTIALS:
LM_DBG("error or bad credentials\n");