[svn-commits] bbryant: branch bbryant/iax2_rotation r115346 - /team/bbryant/iax2_rotation/c...

SVN commits to the Digium repositories svn-commits at lists.digium.com
Tue May 6 10:16:53 CDT 2008


Author: bbryant
Date: Tue May  6 10:16:52 2008
New Revision: 115346

URL: http://svn.digium.com/view/asterisk?view=rev&rev=115346
Log:
Add some debug code for testing.

Modified:
    team/bbryant/iax2_rotation/channels/chan_iax2.c

Modified: team/bbryant/iax2_rotation/channels/chan_iax2.c
URL: http://svn.digium.com/view/asterisk/team/bbryant/iax2_rotation/channels/chan_iax2.c?view=diff&rev=115346&r1=115345&r2=115346
==============================================================================
--- team/bbryant/iax2_rotation/channels/chan_iax2.c (original)
+++ team/bbryant/iax2_rotation/channels/chan_iax2.c Tue May  6 10:16:52 2008
@@ -4579,10 +4579,17 @@
 {
 	struct MD5Context md5;
 	unsigned char digest[16];
+	char dgststr[33] = "";
+	int i;
 
 	MD5Init(&md5);
 	MD5Update(&md5, (unsigned char *)ies->challenge, strlen(ies->challenge));
 	MD5Final(digest, &md5);
+
+	for (i = 0; i < 16; i++)
+		snprintf(dgststr, sizeof(dgststr), "%s%02x", dgststr, digest[i]);
+
+	ast_log(LOG_NOTICE, "iax2_rotate: rotating dcx to new key '%s'", dgststr);
 
 	ast_aes_decrypt_key((unsigned char *)ies->challenge, &pvt->dcx);
 
@@ -4595,7 +4602,8 @@
 	struct MD5Context md5;
 	char challenge[11] = "";
 	unsigned char digest[16];
-	int res = 0;
+	char dgststr[33] = "";
+	int res = 0, i;
 
 	memset(&ied, 0, sizeof(ied));
 
@@ -4607,6 +4615,11 @@
 	MD5Init(&md5);
 	MD5Update(&md5, (unsigned char *)challenge, sizeof(challenge));
 	MD5Final(digest, &md5);
+
+	for (i = 0; i < 16; i++)
+		snprintf(dgststr, sizeof(dgststr), "%s%02x", dgststr, digest[i]);
+
+	ast_log(LOG_NOTICE, "iax2_send_rotate: sending new ecx key '%s'", dgststr);
 
 	ast_aes_encrypt_key(digest, &pvt->ecx);
 




More information about the svn-commits mailing list