[asterisk-commits] dvossel: branch dvossel/iax2encryption_trunk r175291 - /team/dvossel/iax2encr...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Feb 12 13:52:18 CST 2009


Author: dvossel
Date: Thu Feb 12 13:52:18 2009
New Revision: 175291

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=175291
Log:
Updating my gnarly force encryption branch to fix Russel's gnarly reviewboard comments.

Modified:
    team/dvossel/iax2encryption_trunk/channels/chan_iax2.c

Modified: team/dvossel/iax2encryption_trunk/channels/chan_iax2.c
URL: http://svn.digium.com/svn-view/asterisk/team/dvossel/iax2encryption_trunk/channels/chan_iax2.c?view=diff&rev=175291&r1=175290&r2=175291
==============================================================================
--- team/dvossel/iax2encryption_trunk/channels/chan_iax2.c (original)
+++ team/dvossel/iax2encryption_trunk/channels/chan_iax2.c Thu Feb 12 13:52:18 2009
@@ -3756,16 +3756,17 @@
 		ast_log(LOG_WARNING, "No peer provided in the IAX2 dial string '%s'\n", dest);
 		return -1;
 	}
-
 	if (!pds.exten) {
 		pds.exten = defaultrdest;
 	}
-
 	if (create_addr(pds.peer, c, &sin, &cai)) {
 		ast_log(LOG_WARNING, "No address associated with '%s'\n", pds.peer);
 		return -1;
 	}
-
+	if (ast_strlen_zero(cai.secret) && ast_test_flag(iaxs[callno], IAX_FORCE_ENCRYPT)) {
+		ast_log(LOG_WARNING, "Call terminated. No secret given and force encrypt enabled\n");
+		return -1;
+	}
 	if (!pds.username && !ast_strlen_zero(cai.username))
 		pds.username = cai.username;
 	if (!pds.password && !ast_strlen_zero(cai.secret))
@@ -8843,6 +8844,11 @@
 					auth_fail(fr->callno, IAX_COMMAND_REJECT);
 					if (authdebug)
 						ast_log(LOG_NOTICE, "Rejected connect attempt from %s, who was trying to reach '%s@%s'\n", ast_inet_ntoa(sin.sin_addr), iaxs[fr->callno]->exten, iaxs[fr->callno]->context);
+					break;
+				}
+				if (ast_strlen_zero(iaxs[fr->callno]->secret) && ast_test_flag(iaxs[fr->callno], IAX_FORCE_ENCRYPT)) {
+					auth_fail(fr->callno, IAX_COMMAND_REJECT);
+					ast_log(LOG_WARNING, "Rejected connect attempt.  No secret present while force encrypt enabled.\n");
 					break;
 				}
 				if (strcasecmp(iaxs[fr->callno]->exten, "TBD")) {




More information about the asterisk-commits mailing list