[asterisk-bugs] [Asterisk 0017976]: Asterisk Crash on RTCP package in SRTP mode

Asterisk Bug Tracker noreply at bugs.digium.com
Wed Feb 9 09:43:18 CST 2011


A NOTE has been added to this issue. 
====================================================================== 
https://issues.asterisk.org/view.php?id=17976 
====================================================================== 
Reported By:                bernhards
Assigned To:                
====================================================================== 
Project:                    Asterisk
Issue ID:                   17976
Category:                   Resources/res_srtp
Reproducibility:            always
Severity:                   crash
Priority:                   normal
Status:                     acknowledged
Asterisk Version:           SVN 
JIRA:                       SWP-2196 
Regression:                 No 
Reviewboard Link:            
SVN Branch (only for SVN checkouts, not tarball releases): 1.8 
SVN Revision (number only!): 285988 
Request Review:              
====================================================================== 
Date Submitted:             2010-09-10 01:52 CDT
Last Modified:              2011-02-09 09:43 CST
====================================================================== 
Summary:                    Asterisk Crash on RTCP package in SRTP mode
Description: 
"snom360-SIP 8.4.18 42570" connected to Asterisk with TLS. snom makes an
outbound call to another phone (without srtp). Other telephone does ring -
then Asterisk does crash. 

libsrtp version 1.4.4. was used - without a change.
====================================================================== 

---------------------------------------------------------------------- 
 (0131733) bbeers (reporter) - 2011-02-09 09:43
 https://issues.asterisk.org/view.php?id=17976#c131733 
---------------------------------------------------------------------- 
Well, truth is I feel so sure that the patch is a bad idea, I don't even
want to attach it as a submission, but I'll paste it in-line here so people
can see where my work-around was implemented ...

Index: res/res_rtp_asterisk.c
===================================================================
--- res/res_rtp_asterisk.c      (revision 303637)
+++ res/res_rtp_asterisk.c      (working copy)
@@ -1640,6 +1640,7 @@
 static struct ast_frame *ast_rtcp_read(struct ast_rtp_instance
*instance)
 {
        struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);
+       struct ast_srtp *srtp = ast_rtp_instance_get_srtp(instance);
        struct ast_sockaddr addr;
        unsigned int rtcpdata[8192 + AST_FRIENDLY_OFFSET];
        unsigned int *rtcpheader = (unsigned int *)(rtcpdata +
AST_FRIENDLY_OFFSET);
@@ -1652,6 +1653,11 @@
                                0, &addr)) < 0) {
                ast_assert(errno != EBADF);
                if (errno != EAGAIN) {
+                       if (srtp != NULL) {
+                               /* If we have an srtp stream, ignore srtcp
(for now). */
+                               ast_log(LOG_WARNING, "RTCP Read error: %s.
 We ignore during SRTP.\n", strerror(errno));
+                               return &ast_null_frame;
+                       }
                        ast_log(LOG_WARNING, "RTCP Read error: %s. 
Hanging up.\n", strerror(errno));
                        return NULL;
                } 

Issue History 
Date Modified    Username       Field                    Change               
====================================================================== 
2011-02-09 09:43 bbeers         Note Added: 0131733                          
======================================================================




More information about the asterisk-bugs mailing list