[Asterisk-cvs] asterisk/channels chan_sip.c,1.873,1.874

kpfleming kpfleming
Tue Oct 4 18:46:47 CDT 2005


Update of /usr/cvsroot/asterisk/channels
In directory mongoose.digium.com:/tmp/cvs-serv1438/channels

Modified Files:
	chan_sip.c 
Log Message:
generate fewer 'stale nonce' messages (issue #5381)


Index: chan_sip.c
===================================================================
RCS file: /usr/cvsroot/asterisk/channels/chan_sip.c,v
retrieving revision 1.873
retrieving revision 1.874
diff -u -d -r1.873 -r1.874
--- chan_sip.c	4 Oct 2005 22:09:23 -0000	1.873
+++ chan_sip.c	4 Oct 2005 22:42:34 -0000	1.874
@@ -6177,14 +6177,17 @@
 		ast_md5_hash(resp_hash, resp);
 
 		if (wrongnonce) {
-			ast_log(LOG_NOTICE, "stale nonce received from '%s'\n", get_header(req, "To"));
 
 			snprintf(randdata, randlen, "%08x", rand());
 			if (ua_hash && !strncasecmp(ua_hash, resp_hash, strlen(resp_hash))) {
+				if (sipdebug)
+					ast_log(LOG_NOTICE, "stale nonce received from '%s'\n", get_header(req, "To"));
 				/* We got working auth token, based on stale nonce . */
 				transmit_response_with_auth(p, response, req, randdata, reliable, respheader, 1);
 			} else {
-				/* Everything was wrong, so give the device one more try */
+				/* Everything was wrong, so give the device one more try with a new challenge */
+				if (sipdebug)
+					ast_log(LOG_NOTICE, "Bad authentication received from '%s'\n", get_header(req, "To"));
 				transmit_response_with_auth(p, response, req, randdata, reliable, respheader, 0);
 			}
 




More information about the svn-commits mailing list