[Asterisk-code-review] res rtp asterisk.c: don't call dtls perform handshake while ... (asterisk[13])

Stefan Engström asteriskteam at digium.com
Wed May 20 06:25:53 CDT 2015


Stefan Engström has uploaded a new change for review.

  https://gerrit.asterisk.org/490

Change subject: res_rtp_asterisk.c: don't call dtls_perform_handshake while passive
......................................................................

res_rtp_asterisk.c: don't call dtls_perform_handshake while passive

calling dtls_perform_handshake when dtls->dtls_setup ==
AST_RTP_DTLS_SETUP_PASSIVE may lead to seg-faults
within openssl.

ASTERISK-24832
Reported by: StefanEng86
Tested by: StefanEng86

Change-Id: I156bd07323eb8c7f99f59fcfe560ce9c3ae60e36
---
M res/res_rtp_asterisk.c
1 file changed, 6 insertions(+), 4 deletions(-)


  git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/90/490/1

diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c
index b78f6e2..f1718b6 100644
--- a/res/res_rtp_asterisk.c
+++ b/res/res_rtp_asterisk.c
@@ -1627,11 +1627,13 @@
 	}
  
 #ifdef HAVE_OPENSSL_SRTP
-	dtls_perform_handshake(instance, &rtp->dtls, 0);
-
-	if (rtp->rtcp) {
-		dtls_perform_handshake(instance, &rtp->rtcp->dtls, 1);
+	if (&rtp->dtls && (rtp->dtls.dtls_setup != AST_RTP_DTLS_SETUP_PASSIVE)) {
+		dtls_perform_handshake(instance, &rtp->dtls, 0);
+		if (rtp->rtcp) {
+			dtls_perform_handshake(instance, &rtp->rtcp->dtls, 1);
+		}
 	}
+
 #endif
 
 	if (!strictrtp) {

-- 
To view, visit https://gerrit.asterisk.org/490
To unsubscribe, visit https://gerrit.asterisk.org/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I156bd07323eb8c7f99f59fcfe560ce9c3ae60e36
Gerrit-PatchSet: 1
Gerrit-Project: asterisk
Gerrit-Branch: 13
Gerrit-Owner: Stefan Engström <stefanen at kth.se>



More information about the asterisk-code-review mailing list