[asterisk-commits] tilghman: branch 1.2 r170580 - /branches/1.2/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 23 13:19:06 CST 2009


Author: tilghman
Date: Fri Jan 23 13:19:06 2009
New Revision: 170580

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=170580
Log:
Updates to AST-2009-001

Modified:
    branches/1.2/channels/chan_iax2.c

Modified: branches/1.2/channels/chan_iax2.c
URL: http://svn.digium.com/svn-view/asterisk/branches/1.2/channels/chan_iax2.c?view=diff&rev=170580&r1=170579&r2=170580
==============================================================================
--- branches/1.2/channels/chan_iax2.c (original)
+++ branches/1.2/channels/chan_iax2.c Fri Jan 23 13:19:06 2009
@@ -5482,8 +5482,11 @@
 			return -1;
 		}
 	} else if (!ast_strlen_zero(p->secret) || !ast_strlen_zero(p->inkeys)) {
-		if (authdebug)
+		if (authdebug &&
+				((!ast_strlen_zero(p->secret) && (p->authmethods & IAX_AUTH_MD5) && !ast_strlen_zero(iaxs[callno]->challenge)) ||
+				 (!ast_strlen_zero(p->inkeys) && (p->authmethods & IAX_AUTH_RSA) && !ast_strlen_zero(iaxs[callno]->challenge)))) {
 			ast_log(LOG_NOTICE, "Inappropriate authentication received for '%s'\n", p->name);
+		}
 		if (ast_test_flag(p, IAX_TEMPONLY))
 			destroy_peer(p);
 		return -1;
@@ -6092,7 +6095,7 @@
 	struct iax2_peer *p;
 	int authmethods;
 
-	if (!iaxs[callno]) {
+	if (!callno || !iaxs[callno]) {
 		return 0;
 	}
 
@@ -6110,7 +6113,7 @@
 	}
 	
 	memset(&ied, 0, sizeof(ied));
-	iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, p->authmethods);
+	iax_ie_append_short(&ied, IAX_IE_AUTHMETHODS, authmethods);
 	if (authmethods & (IAX_AUTH_RSA | IAX_AUTH_MD5)) {
 		/* Build the challenge */
 		snprintf(iaxs[callno]->challenge, sizeof(iaxs[callno]->challenge), "%d", rand());




More information about the asterisk-commits mailing list