]> git.ipfire.org Git - thirdparty/asterisk.git/commitdiff
Ensure chan_sip rejects encrypted streams without crypto info
authorKinsey Moore <kmoore@digium.com>
Mon, 31 Dec 2012 14:41:37 +0000 (14:41 +0000)
committerKinsey Moore <kmoore@digium.com>
Mon, 31 Dec 2012 14:41:37 +0000 (14:41 +0000)
This ensures that Asterisk rejects encrypted media streams (RTP/SAVP
audio and video) that are missing cryptographic keys and ensures that
the incoming SDP is consistent with RFC4568 as far as having a crypto
attribute present for any SAVP streams.

Review: https://reviewboard.asterisk.org/r/2204/

git-svn-id: https://origsvn.digium.com/svn/asterisk/branches/1.8@378217 65c4cc65-6c06-0410-ace0-fbb531ad65f3

channels/chan_sip.c

index d0857dcfbb5362ca572b5767c759313624472df1..18a0f7cf2d768bbb8d74779e307778bb439ef073 100644 (file)
@@ -9547,6 +9547,15 @@ static int process_sdp(struct sip_pvt *p, struct sip_request *req, int t38action
                                  type, value,
                                  (processed == TRUE)? "OK." : "UNSUPPORTED OR FAILED.");
                }
+
+               /* Ensure crypto lines are provided where necessary */
+               if (audio && secure_audio && !processed_crypto) {
+                       ast_log(LOG_WARNING, "Rejecting secure audio stream without encryption details: %s\n", m);
+                       return -1;
+               } else if (video && secure_video && !processed_crypto) {
+                       ast_log(LOG_WARNING, "Rejecting secure video stream without encryption details: %s\n", m);
+                       return -1;
+               }
        }
 
        /* Sanity checks */