summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKinsey Moore <kmoore@digium.com>2013-03-27 17:07:44 +0000
committerKinsey Moore <kmoore@digium.com>2013-03-27 17:07:44 +0000
commit15bbfb941f2faf637e00d6246be6799579836a90 (patch)
tree1a2dd390459122a9400ddfb0f71efcbfc30a002f
parent0ffce56f1b5113b1060fd535901a28ecf0671daf (diff)
Fix white noise on SRTP decryption
When res_rtp_asterisk.c was altered to avoid attempting to apply unprotect algorithms to non-audio RTP packets, the test used was incorrect. This caused the audio packets to not be decrypted and resulted in loud white noise on the other endpoint (or both endpoints depending on the call legs involved). The test now properly checks the version field in the RTP header to ensure that RTP and RTCP are decrypted while other types of packets are not. (closes issue ASTERISK-21323) Reported by: andrea Tested by: Kinsey Moore, andrea, John Bigelow Patches: whitenoise_fix.diff uploaded by Kinsey Moore ........ Merged revisions 384048 from http://svn.asterisk.org/svn/asterisk/branches/1.8 ........ Merged revisions 384049 from http://svn.asterisk.org/svn/asterisk/branches/11 git-svn-id: https://origsvn.digium.com/svn/asterisk/trunk@384050 65c4cc65-6c06-0410-ace0-fbb531ad65f3
-rw-r--r--res/res_rtp_asterisk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index a96103fe1..cf7c87910 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1491,7 +1491,7 @@ static int __rtp_recvfrom(struct ast_rtp_instance *instance, void *buf, size_t s
}
#endif
- if ((*in > 1) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
+ if ((*in & 0xC0) && res_srtp && srtp && res_srtp->unprotect(srtp, buf, &len, rtcp) < 0) {
return -1;
}