[svn-commits] twilson: branch group/srtp r165809 - /team/group/srtp/channels/

SVN commits to the Digium repositories svn-commits at lists.digium.com
Thu Dec 18 15:57:50 CST 2008


Author: twilson
Date: Thu Dec 18 15:57:50 2008
New Revision: 165809

URL: http://svn.digium.com/view/asterisk?view=rev&rev=165809
Log:
minor formatting issues

Modified:
    team/group/srtp/channels/chan_sip.c
    team/group/srtp/channels/sdp_crypto.c

Modified: team/group/srtp/channels/chan_sip.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/chan_sip.c?view=diff&rev=165809&r1=165808&r2=165809
==============================================================================
--- team/group/srtp/channels/chan_sip.c (original)
+++ team/group/srtp/channels/chan_sip.c Thu Dec 18 15:57:50 2008
@@ -4897,8 +4897,6 @@
 			/* We're replacing a call. */
 			p->options->replaces = ast_var_value(current);
 		} else if (!strcasecmp(ast_var_name(current), "SIPSRTP")) {
-			ast_log(LOG_NOTICE, "SIPSRTP\n");
-
 			if (!p->srtp) {
 				if (setup_srtp(p) < 0) {
 					ast_log(LOG_WARNING, "SRTP setup failed\n");
@@ -4910,8 +4908,6 @@
 				ast_set_flag(p->srtp, SRTP_ENCR_OPTIONAL);
 			}
 		} else if (!strcasecmp(ast_var_name(current), "SIPSRTP_CRYPTO")) {
-			ast_log(LOG_NOTICE, "SIPSRTP_CRYPTO\n");
-
 			if (!p->srtp) {
 				if (setup_srtp(p) < 0) {
 					ast_log(LOG_WARNING, "SRTP setup failed\n");
@@ -4927,8 +4923,6 @@
 				ast_log(LOG_WARNING,"Invalid SIPSRTP_CRYPTO value (%s), enable or disable expected\n", ast_var_value(current));
 			}
 		} else if (!strcasecmp(ast_var_name(current), "SIPSRTP_MIKEY")) {
-			ast_log(LOG_NOTICE, "SIPSRTP_MIKEY\n");
-
 			if (!p->srtp) {
 				if (setup_srtp(p) < 0) {
 					ast_log(LOG_WARNING, "SRTP setup failed\n");

Modified: team/group/srtp/channels/sdp_crypto.c
URL: http://svn.digium.com/view/asterisk/team/group/srtp/channels/sdp_crypto.c?view=diff&rev=165809&r1=165808&r2=165809
==============================================================================
--- team/group/srtp/channels/sdp_crypto.c (original)
+++ team/group/srtp/channels/sdp_crypto.c Thu Dec 18 15:57:50 2008
@@ -71,6 +71,8 @@
 struct sdp_crypto *sdp_crypto_setup(void)
 {
 	struct sdp_crypto *p = sdp_crypto_alloc();
+	int key_len;
+	unsigned char remote_key[SRTP_MASTER_LEN];
 
 	if (!p)
 		return NULL;
@@ -83,21 +85,15 @@
 	ast_base64encode(p->local_key64, p->local_key,
 			 SRTP_MASTER_LEN, sizeof(p->local_key64));
 
-	{
-	    /* FIXME mikma, remove block */
-		int key_len;
-		unsigned char remote_key[SRTP_MASTER_LEN];
-		
-		key_len = ast_base64decode(remote_key, p->local_key64, sizeof(remote_key));
-
-		if (key_len != SRTP_MASTER_LEN)
-			ast_log(LOG_ERROR, "base64 encode/decode bad len %d != %d\n", key_len, SRTP_MASTER_LEN);
-
-		if (memcmp(remote_key, p->local_key, SRTP_MASTER_LEN))
-			ast_log(LOG_ERROR, "base64 encode/decode bad key\n");
-	}
-
-	ast_log(LOG_DEBUG, "local_key64 %s len %zu\n", p->local_key64, strlen(p->local_key64));
+	key_len = ast_base64decode(remote_key, p->local_key64, sizeof(remote_key));
+
+	if (key_len != SRTP_MASTER_LEN)
+		ast_log(LOG_ERROR, "base64 encode/decode bad len %d != %d\n", key_len, SRTP_MASTER_LEN);
+
+	if (memcmp(remote_key, p->local_key, SRTP_MASTER_LEN))
+		ast_log(LOG_ERROR, "base64 encode/decode bad key\n");
+
+	ast_debug(1 , "local_key64 %s len %zu\n", p->local_key64, strlen(p->local_key64));
 	return p;
 }
 
@@ -163,8 +159,7 @@
 	}
 
 
-	if (option_debug > 1)
-		ast_log(LOG_DEBUG, "SRTP policy activated\n");
+	ast_debug(1 , "SRTP policy activated\n");
 	res = 0;
 
 err:




More information about the svn-commits mailing list