[asterisk-commits] file: branch 11 r378555 - in /branches/11: ./ res/res_rtp_asterisk.c

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


Author: file
Date: Fri Jan  4 15:16:32 2013
New Revision: 378555

URL: http://svnview.digium.com/svn/asterisk?view=rev&rev=378555
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

Modified:
    branches/11/   (props changed)
    branches/11/res/res_rtp_asterisk.c

Propchange: branches/11/
------------------------------------------------------------------------------
--- branch-1.8-merged (original)
+++ branch-1.8-merged Fri Jan  4 15:16:32 2013
@@ -1,1 +1,1 @@
-/branches/1.8:1-378147,378164,378356,378375,378427,378455-378456,378486,378514
+/branches/1.8:1-378147,378164,378356,378375,378427,378455-378456,378486,378514,378553

Modified: branches/11/res/res_rtp_asterisk.c
URL: http://svnview.digium.com/svn/asterisk/branches/11/res/res_rtp_asterisk.c?view=diff&rev=378555&r1=378554&r2=378555
==============================================================================
--- branches/11/res/res_rtp_asterisk.c (original)
+++ branches/11/res/res_rtp_asterisk.c Fri Jan  4 15:16:32 2013
@@ -1377,6 +1377,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;
@@ -1384,8 +1385,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 */
@@ -1458,7 +1457,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