[asterisk-commits] dvossel: branch 1.6.1 r199141 - in /branches/1.6.1: ./ channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Jun 4 14:16:18 CDT 2009


Author: dvossel
Date: Thu Jun  4 14:16:15 2009
New Revision: 199141

URL: http://svn.asterisk.org/svn-view/asterisk?view=rev&rev=199141
Log:
Merged revisions 199139 via svnmerge from 
https://origsvn.digium.com/svn/asterisk/trunk

................
  r199139 | dvossel | 2009-06-04 14:10:16 -0500 (Thu, 04 Jun 2009) | 9 lines
  
  Merged revisions 199138 via svnmerge from 
  https://origsvn.digium.com/svn/asterisk/branches/1.4
  
  ........
    r199138 | dvossel | 2009-06-04 14:00:15 -0500 (Thu, 04 Jun 2009) | 3 lines
    
    Additional updates to AST-2009-001
  ........
................

Modified:
    branches/1.6.1/   (props changed)
    branches/1.6.1/channels/chan_iax2.c

Propchange: branches/1.6.1/
------------------------------------------------------------------------------
Binary property 'trunk-merged' - no diff available.

Modified: branches/1.6.1/channels/chan_iax2.c
URL: http://svn.asterisk.org/svn-view/asterisk/branches/1.6.1/channels/chan_iax2.c?view=diff&rev=199141&r1=199140&r2=199141
==============================================================================
--- branches/1.6.1/channels/chan_iax2.c (original)
+++ branches/1.6.1/channels/chan_iax2.c Thu Jun  4 14:16:15 2009
@@ -609,7 +609,8 @@
 		/*! Default parkinglot */
 		AST_STRING_FIELD(parkinglot);
 	);
-	
+	/*! AUTHREJ all AUTHREP frames */
+	int authrej;
 	/*! permitted authentication methods */
 	int authmethods;
 	/*! permitted encryption methods */
@@ -6252,6 +6253,18 @@
 			ast_string_field_set(iaxs[callno], secret, user->secret);
 		res = 0;
 		user = user_unref(user);
+	} else {
+		 /* user was not found, but we should still fake an AUTHREQ.
+		  * Set authmethods to the last known authmethod used by the system
+		  * Set a fake secret, it's not looked at, just required to attempt authentication.
+		  * Set authrej so the AUTHREP is rejected without even looking at its contents */
+		iaxs[callno]->authmethods = last_authmethod ? last_authmethod : (IAX_AUTH_MD5 | IAX_AUTH_PLAINTEXT);
+		ast_string_field_set(iaxs[callno], secret, "badsecret");
+		iaxs[callno]->authrej = 1;
+		if (!ast_strlen_zero(iaxs[callno]->username)) {
+			/* only send the AUTHREQ if a username was specified. */
+			res = 0;
+		}
 	}
 	ast_set2_flag(iaxs[callno], iax2_getpeertrunk(*sin), IAX_TRUNK);	
 	return res;
@@ -6362,6 +6375,9 @@
 		.name = p->username,	
 	};
 
+	if (p->authrej) {
+		return res;
+	}
 	user = ao2_find(users, &tmp_user, OBJ_POINTER);
 	if (user) {
 		if (ast_test_flag(p, IAX_MAXAUTHREQ)) {




More information about the asterisk-commits mailing list