aboutsummaryrefslogtreecommitdiffstats
path: root/channels/iax2-parser.c
diff options
context:
space:
mode:
authorrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 18:16:24 +0000
committerrussell <russell@f38db490-d61c-443f-a65b-d21fe96a405b>2008-08-01 18:16:24 +0000
commit6c9711840582fdc944e169560440cc2a51575914 (patch)
tree517386774bf6b37ad8eae1fa5f485c379d1f8e34 /channels/iax2-parser.c
parentc60aab53f2e66b27926d1b3dfaf1559c0da4a507 (diff)
Merge changes from team/bbryant/keyrotation
This set of changes enhances IAX2 encryption support by adding key rotation to provide enhanced security. The key used for encryption is rotated right after the call gets set up, and then again every few minutes. This was discussed at the last AstriDevCon. For interoperability with older versions of Asterisk, there is an option that disables key rotation. (closes issue #13018) Reported by: bbryant Patches: 07072008__iax2_key_rotation.diff uploaded by bbryant (license 36) Tested by: russell, bbryant git-svn-id: http://svn.digium.com/svn/asterisk/trunk@135158 f38db490-d61c-443f-a65b-d21fe96a405b
Diffstat (limited to 'channels/iax2-parser.c')
-rw-r--r--channels/iax2-parser.c12
1 files changed, 11 insertions, 1 deletions
diff --git a/channels/iax2-parser.c b/channels/iax2-parser.c
index 010c85056..09ec3b5e8 100644
--- a/channels/iax2-parser.c
+++ b/channels/iax2-parser.c
@@ -88,6 +88,16 @@ static void dump_addr(char *output, int maxlen, void *value, int len)
}
}
+static void dump_string_hex(char *output, int maxlen, void *value, int len)
+{
+ int i = 0;
+
+ while (len-- && (i + 1) * 4 < maxlen) {
+ sprintf(output + (4 * i), "\\x%2.2x", *((unsigned char *)value + i));
+ i++;
+ }
+}
+
static void dump_string(char *output, int maxlen, void *value, int len)
{
maxlen--;
@@ -229,7 +239,7 @@ static struct iax2_ie {
{ IAX_IE_ADSICPE, "ADSICPE", dump_short },
{ IAX_IE_DNID, "DNID", dump_string },
{ IAX_IE_AUTHMETHODS, "AUTHMETHODS", dump_short },
- { IAX_IE_CHALLENGE, "CHALLENGE", dump_string },
+ { IAX_IE_CHALLENGE, "CHALLENGE", dump_string_hex },
{ IAX_IE_MD5_RESULT, "MD5 RESULT", dump_string },
{ IAX_IE_RSA_RESULT, "RSA RESULT", dump_string },
{ IAX_IE_APPARENT_ADDR, "APPARENT ADDRESS", dump_addr },