Browse Source

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
Daniel-Constantin Mierla 14 years ago
parent
commit
010f9159f9
1 changed files with 12 additions and 0 deletions
  1. 12 0
      modules_k/auth_db/authorize.c

+ 12 - 0
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");