[asterisk-commits] file: trunk r378557 - in /trunk: ./ res/res_rtp_asterisk.c

SVN commits to the Asterisk project asterisk-commits at lists.digium.com
Fri Jan 4 15:18:11 CST 2013


Author: file
Date: Fri Jan  4 15:18:07 2013
New Revision: 378557

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378557
Log:
Don't pass STUN packets through the SRTP unprotect function.

(closes issue AST-1036)
Reported by: jbigelow
........

Merged revisions 378553 from http://svn.asterisk.org/svn/asterisk/branches/1.8
........

Merged revisions 378555 from http://svn.asterisk.org/svn/asterisk/branches/11

Modified:
    trunk/   (props changed)
    trunk/res/res_rtp_asterisk.c

Propchange: trunk/
------------------------------------------------------------------------------
Binary property 'branch-11-merged' - no diff available.

Modified: trunk/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/trunk/res/res_rtp_asterisk.c?view=diff&rev=378557&r1=378556&r2=378557
==============================================================================
--- trunk/res/res_rtp_asterisk.c (original)
+++ trunk/res/res_rtp_asterisk.c Fri Jan  4 15:18:07 2013
@@ -1378,6 +1378,7 @@
 	int len;
 	struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
 	struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
+	char *in = buf;
 
 	if ((len = ast_recvfrom(rtcp ? rtp->rtcp->s : rtp->s, buf, size, flags, sa)) < 0) {
 	   return len;
@@ -1385,8 +1386,6 @@
 
 #ifdef HAVE_OPENSSL_SRTP
 	if (!rtcp) {
-		char *in = buf;
-
 		dtls_srtp_check_pending(instance, rtp);
 
 		/* If this is an SSL packet pass it to OpenSSL for processing */
@@ -1459,7 +1458,7 @@
 		rtp->passthrough = 0;
 	}
 
-	if (res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
+	if ((*in > 1) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
 	   return -1;
 	}
 




More information about the asterisk-commits mailing list