[asterisk-commits] kmoore: branch kmoore/pimp_sip_srtp r386539 - in /team/kmoore/pimp_sip_srtp: ...

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Thu Apr 25 13:21:37 CDT 2013


Author: kmoore
Date: Thu Apr 25 13:21:33 2013
New Revision: 386539

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=386539
Log:
Remove optional encryption because it's silly

Modified:
    team/kmoore/pimp_sip_srtp/include/asterisk/res_sip.h
    team/kmoore/pimp_sip_srtp/res/res_sip/sip_configuration.c
    team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c

Modified: team/kmoore/pimp_sip_srtp/include/asterisk/res_sip.h
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pimp_sip_srtp/include/asterisk/res_sip.h?view=diff&rev=386539&r1=386538&r2=386539
==============================================================================
--- team/kmoore/pimp_sip_srtp/include/asterisk/res_sip.h (original)
+++ team/kmoore/pimp_sip_srtp/include/asterisk/res_sip.h Thu Apr 25 13:21:33 2013
@@ -253,8 +253,6 @@
 	/*! Invalid media encryption configuration */
 	AST_SIP_MEDIA_TRANSPORT_INVALID = 0,
 	/*! Do not allow any encryption of session media */
-	AST_SIP_MEDIA_ENCRYPT_DENY,
-	/*! Do not offer media encryption, but accept it if offered */
 	AST_SIP_MEDIA_ENCRYPT_NONE,
 	/*! Offer SDES-encrypted session media */
 	AST_SIP_MEDIA_ENCRYPT_SDES,

Modified: team/kmoore/pimp_sip_srtp/res/res_sip/sip_configuration.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pimp_sip_srtp/res/res_sip/sip_configuration.c?view=diff&rev=386539&r1=386538&r2=386539
==============================================================================
--- team/kmoore/pimp_sip_srtp/res/res_sip/sip_configuration.c (original)
+++ team/kmoore/pimp_sip_srtp/res/res_sip/sip_configuration.c Thu Apr 25 13:21:33 2013
@@ -280,9 +280,7 @@
 {
 	struct ast_sip_endpoint *endpoint = obj;
 
-	if (!strcasecmp("deny", var->value)) {
-		endpoint->media_encryption = AST_SIP_MEDIA_ENCRYPT_DENY;
-	} else if (!strcasecmp("no", var->value)) {
+	if (!strcasecmp("no", var->value)) {
 		endpoint->media_encryption = AST_SIP_MEDIA_ENCRYPT_NONE;
 	} else if (!strcasecmp("sdes", var->value)) {
 		endpoint->media_encryption = AST_SIP_MEDIA_ENCRYPT_SDES;

Modified: team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c
URL: http://svnview.digium.com/svn/asterisk/team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c?view=diff&rev=386539&r1=386538&r2=386539
==============================================================================
--- team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c (original)
+++ team/kmoore/pimp_sip_srtp/res/res_sip_sdp_rtp.c Thu Apr 25 13:21:33 2013
@@ -501,31 +501,7 @@
 		return incoming_encryption;
 	}
 
-	switch (endpoint->media_encryption) {
-	case AST_SIP_MEDIA_ENCRYPT_DENY:
-		if (incoming_encryption != AST_SIP_MEDIA_ENCRYPT_NONE) {
-			/* Encryption offered, but not allowed */
-			return AST_SIP_MEDIA_TRANSPORT_INVALID;
-		}
-		break;
-	case AST_SIP_MEDIA_ENCRYPT_NONE:
-		if (incoming_encryption != AST_SIP_MEDIA_ENCRYPT_SDES) {
-			/* Can only silently upgrade to SDES from no encryption */
-			return AST_SIP_MEDIA_TRANSPORT_INVALID;
-		}
-		break;
-	case AST_SIP_MEDIA_ENCRYPT_SDES:
-		/* Can't silently upgrade or downgrade from SDES */
-		return AST_SIP_MEDIA_TRANSPORT_INVALID;
-	case AST_SIP_MEDIA_ENCRYPT_DTLS:
-		/* Can't silently upgrade or downgrade from DTLS */
-		return AST_SIP_MEDIA_TRANSPORT_INVALID;
-	case AST_SIP_MEDIA_TRANSPORT_INVALID:
-		/* This shouldn't ever happen */
-		return AST_SIP_MEDIA_TRANSPORT_INVALID;
-	}
-
-	return incoming_encryption;
+	return AST_SIP_MEDIA_TRANSPORT_INVALID;
 }
 
 static int setup_sdes_srtp(struct ast_sip_session_media *session_media,
@@ -615,7 +591,7 @@
 	pjmedia_sdp_attr *attr;
 	const char *crypto_attribute;
 
-	if (!session_media->srtp && session->endpoint->media_encryption != AST_SIP_MEDIA_ENCRYPT_DENY) {
+	if (!session_media->srtp && session->endpoint->media_encryption != AST_SIP_MEDIA_ENCRYPT_NONE) {
 		session_media->srtp = ast_sdp_srtp_alloc();
 		if (!session_media->srtp) {
 			return -1;




More information about the asterisk-commits mailing list