aboutsummaryrefslogtreecommitdiffstats
path: root/channels
diff options
context:
space:
mode:
authordvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-23 17:59:55 +0000
committerdvossel <dvossel@f38db490-d61c-443f-a65b-d21fe96a405b>2009-02-23 17:59:55 +0000
commit1743f9a2fc721f0a68cf9e6daac1b2edf5acb144 (patch)
treed58eba8d256ec4716b761e1d099aeff198255f01 /channels
parent90430c3f7380321127005cf433a6f0e24d235680 (diff)
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 git-svn-id: http://svn.digium.com/svn/asterisk/trunk@178030 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels')
-rw-r--r--channels/chan_iax2.c8
1 files changed, 3 insertions, 5 deletions
diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c
index 4de90b772..ef3003071 100644
--- a/channels/chan_iax2.c
+++ b/channels/chan_iax2.c
@@ -1310,9 +1310,9 @@ static int get_encrypt_methods(const char *s)
{
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 @@ static int __iax2_show_peers(int manager, int fd, struct mansession *s, int argc
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 @@ static int set_config(char *config_file, int reload)
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