[sr-dev] git:master: handle all cases after auth_api.pre_auth call

Michal Matyska michal.matyska at iptel.org
Mon Apr 11 17:26:14 CEST 2011


Module: sip-router
Branch: master
Commit: 87ee74902ef5c4a86fc3130a48ab783b1c605461
URL:    http://git.sip-router.org/cgi-bin/gitweb.cgi/sip-router/?a=commit;h=87ee74902ef5c4a86fc3130a48ab783b1c605461

Author: Michal Matyska <michal.matyska at iptel.org>
Committer: Michal Matyska <michal.matyska at iptel.org>
Date:   Mon Apr 11 10:20:43 2011 -0500

handle all cases after auth_api.pre_auth call

Added cases NO_CREDENTIALS, STALE_NONCE and NONCE_REUSED to the switch.
This prevents segfault after uninitialized var is used in gen_ha1 when
the code continues to check the credentials if there were none.

---

 modules_s/auth_db/authorize.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/modules_s/auth_db/authorize.c b/modules_s/auth_db/authorize.c
index da1d6b4..1d3add1 100644
--- a/modules_s/auth_db/authorize.c
+++ b/modules_s/auth_db/authorize.c
@@ -345,10 +345,14 @@ static inline int authenticate(struct sip_msg* msg, str* realm, authdb_table_inf
 		ret = -2;
 		goto end;
 		
+	case STALE_NONCE:
 	case NOT_AUTHENTICATED: 
+	case NO_CREDENTIALS:
 		ret = -1;
 		goto end;
 		
+	case NONCE_REUSED:
+		DBG("auth_db:authenticate: NONCE_REUSED\n");
 	case DO_AUTHENTICATION: 
 		break;
 		




More information about the sr-dev mailing list