[asterisk-commits] dvossel: trunk r178030 - /trunk/channels/chan_iax2.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Mon Feb 23 11:59:55 CST 2009


Author: dvossel
Date: Mon Feb 23 11:59:55 2009
New Revision: 178030

URL: http://svn.digium.com/svn-view/asterisk?view=rev&rev=178030
Log:
Changes the way keyrotation is enabled by default

Key rotation was enabled by default by setting the global encryption method to IAX_ENCRYPT_KEYROTATE.  the problem with this is that if encryption is not enabled, and the encryption method is set to anything except 0, the peer appears to have encryption enabled when issuing a "iax2 show peers".  Rather than have the key rotation bit always set by default, it is now only set when an encryption method is enabled. 

(closes issue #14523)
Reported by: mvanbaak

Modified:
    trunk/channels/chan_iax2.c

Modified: trunk/channels/chan_iax2.c
URL: http://svn.digium.com/svn-view/asterisk/trunk/channels/chan_iax2.c?view=diff&rev=178030&r1=178029&r2=178030
==============================================================================
--- trunk/channels/chan_iax2.c (original)
+++ trunk/channels/chan_iax2.c Mon Feb 23 11:59:55 2009
@@ -1310,9 +1310,9 @@
 {
 	int e;
 	if (!strcasecmp(s, "aes128"))
-		e = IAX_ENCRYPT_AES128;
+		e = IAX_ENCRYPT_AES128 | IAX_ENCRYPT_KEYROTATE;
 	else if (ast_true(s))
-		e = IAX_ENCRYPT_AES128;
+		e = IAX_ENCRYPT_AES128 | IAX_ENCRYPT_KEYROTATE;
 	else
 		e = 0;
 	return e;
@@ -5310,7 +5310,7 @@
 			unmonitored_peers++;
 		
 		ast_copy_string(nm, ast_inet_ntoa(peer->mask), sizeof(nm));
-		
+
 		snprintf(srch, sizeof(srch), FORMAT, name, 
 			 peer->addr.sin_addr.s_addr ? ast_inet_ntoa(peer->addr.sin_addr) : "(Unspecified)",
 			 ast_test_flag(peer, IAX_DYNAMIC) ? "(D)" : "(S)",
@@ -11257,8 +11257,6 @@
 	memset(&globalflags, 0, sizeof(globalflags));
 	ast_set_flag(&globalflags, IAX_RTUPDATE);
 	
-	/* Turns on support for key rotation during encryption. */
-	iax2_encryption |= IAX_ENCRYPT_KEYROTATE;
 #ifdef SO_NO_CHECK
 	nochecksums = 0;
 #endif




More information about the asterisk-commits mailing list