<p>Joshua Colp <strong>merged</strong> this change.</p><p><a href="https://gerrit.asterisk.org/9738">View Change</a></p><div style="white-space:pre-wrap">Approvals:
  Joshua Colp: Looks good to me, but someone else must approve; Approved for Submit
  Richard Mudgett: Looks good to me, approved

</div><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_rtp_asterisk: In Developer Mode, do not require OpenSSL.<br><br>OpenSSL is an optional external library and should stay optional even when<br>Developer Mode is configured.<br><br>ASTERISK-27990<br><br>Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b<br>---<br>M res/res_rtp_asterisk.c<br>1 file changed, 20 insertions(+), 20 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_rtp_asterisk.c b/res/res_rtp_asterisk.c</span><br><span>index 074bcea..1327d71 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -278,7 +278,7 @@</span><br><span>    enum ast_media_type stream_type;</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> struct dtls_details {</span><br><span>         SSL *ssl;         /*!< SSL session */</span><br><span>     BIO *read_bio;    /*!< Memory buffer for reading */</span><br><span>@@ -423,7 +423,7 @@</span><br><span>         unsigned int ice_num_components; /*!< The number of ICE components */</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>      SSL_CTX *ssl_ctx; /*!< SSL context */</span><br><span>     enum ast_rtp_dtls_verify dtls_verify; /*!< What to verify */</span><br><span>      enum ast_srtp_suite suite;   /*!< SRTP crypto suite */</span><br><span>@@ -500,7 +500,7 @@</span><br><span>      /* VP8: sequence number for the RTCP FIR FCI */</span><br><span>      int firseq;</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>     struct dtls_details dtls; /*!< DTLS state information */</span><br><span> #endif</span><br><span> </span><br><span>@@ -568,7 +568,7 @@</span><br><span> static int ast_rtp_extension_enable(struct ast_rtp_instance *instance, enum ast_rtp_extension extension);</span><br><span> static int ast_rtp_bundle(struct ast_rtp_instance *child, struct ast_rtp_instance *parent);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> static int ast_rtp_activate(struct ast_rtp_instance *instance);</span><br><span> static void dtls_srtp_check_pending(struct ast_rtp_instance *instance, struct ast_rtp *rtp, int rtcp);</span><br><span> static void dtls_srtp_start_timeout_timer(struct ast_rtp_instance *instance, struct ast_rtp *rtp, int rtcp);</span><br><span>@@ -1587,7 +1587,7 @@</span><br><span> };</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> static int dtls_verify_callback(int preverify_ok, X509_STORE_CTX *ctx)</span><br><span> {</span><br><span>    /* We don't want to actually verify the certificate so just accept what they have provided */</span><br><span>@@ -2265,7 +2265,7 @@</span><br><span> #ifdef HAVE_PJPROJECT</span><br><span>   .ice = &ast_rtp_ice,</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>  .dtls = &ast_rtp_dtls,</span><br><span>   .activate = ast_rtp_activate,</span><br><span> #endif</span><br><span>@@ -2277,7 +2277,7 @@</span><br><span>      .bundle = ast_rtp_bundle,</span><br><span> };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> /*! \pre instance is locked */</span><br><span> static void dtls_perform_handshake(struct ast_rtp_instance *instance, struct dtls_details *dtls, int rtcp)</span><br><span> {</span><br><span>@@ -2311,7 +2311,7 @@</span><br><span> }</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> static void dtls_perform_setup(struct dtls_details *dtls)</span><br><span> {</span><br><span>      if (!dtls->ssl || !SSL_is_init_finished(dtls->ssl)) {</span><br><span>@@ -2355,7 +2355,7 @@</span><br><span>          }</span><br><span>    }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> </span><br><span>   dtls_perform_setup(&rtp->dtls);</span><br><span>       dtls_perform_handshake(instance, &rtp->dtls, 0);</span><br><span>@@ -2489,7 +2489,7 @@</span><br><span>      return 1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> /*! \pre instance is locked */</span><br><span> static int dtls_srtp_handle_timeout(struct ast_rtp_instance *instance, int rtcp)</span><br><span> {</span><br><span>@@ -2835,7 +2835,7 @@</span><br><span>          return len;</span><br><span>       }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>       /* If this is an SSL packet pass it to OpenSSL for processing. RFC section for first byte value:</span><br><span>      * https://tools.ietf.org/html/rfc5764#section-5.1.2 */</span><br><span>      if ((*in >= 20) && (*in <= 63)) {</span><br><span>@@ -3527,7 +3527,7 @@</span><br><span>      }</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>     rtp->rekeyid = -1;</span><br><span>        rtp->dtls.timeout_timer = -1;</span><br><span> #endif</span><br><span>@@ -3543,7 +3543,7 @@</span><br><span>   struct timespec ts = { .tv_sec = wait.tv_sec, .tv_nsec = wait.tv_usec * 1000, };</span><br><span> #endif</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>      ast_rtp_dtls_stop(instance);</span><br><span> #endif</span><br><span> </span><br><span>@@ -7161,7 +7161,7 @@</span><br><span>                                   return;</span><br><span>                              }</span><br><span>                            rtp->rtcp->s = -1;</span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>                            rtp->rtcp->dtls.timeout_timer = -1;</span><br><span> #endif</span><br><span>                          rtp->rtcp->schedid = -1;</span><br><span>@@ -7224,7 +7224,7 @@</span><br><span>                                       rtp_add_candidates_to_ice(instance, rtp, &rtp->rtcp->us, ast_sockaddr_port(&rtp->rtcp->us), AST_RTP_ICE_COMPONENT_RTCP, TRANSPORT_SOCKET_RTCP);</span><br><span>                          }</span><br><span> #endif</span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>                                 dtls_setup_rtcp(instance);</span><br><span> #endif</span><br><span>                         } else {</span><br><span>@@ -7244,7 +7244,7 @@</span><br><span>                             rtp->rtcp->s = rtp->s;</span><br><span>                              ast_rtp_instance_get_remote_address(instance, &addr);</span><br><span>                            ast_sockaddr_copy(&rtp->rtcp->them, &addr);</span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>                           if (rtp->rtcp->dtls.ssl && rtp->rtcp->dtls.ssl != rtp->dtls.ssl) {</span><br><span>                                    SSL_free(rtp->rtcp->dtls.ssl);</span><br><span>                                 }</span><br><span>@@ -7272,7 +7272,7 @@</span><br><span>                            if (rtp->rtcp->s > -1 && rtp->rtcp->s != rtp->s) {</span><br><span>                                         close(rtp->rtcp->s);</span><br><span>                           }</span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>                           ao2_unlock(instance);</span><br><span>                                dtls_srtp_stop_timeout_timer(instance, rtp, 1);</span><br><span>                              ao2_lock(instance);</span><br><span>@@ -7547,7 +7547,7 @@</span><br><span>  struct ast_rtp *rtp = ast_rtp_instance_get_data(instance);</span><br><span>   struct ast_sockaddr addr = { {0,} };</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>    ao2_unlock(instance);</span><br><span>        AST_SCHED_DEL_UNREF(rtp->sched, rtp->rekeyid, ao2_ref(instance, -1));</span><br><span> </span><br><span>@@ -7767,7 +7767,7 @@</span><br><span> </span><br><span>  AST_VECTOR_APPEND(&parent_rtp->ssrc_mapping, mapping);</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span>   /* If DTLS-SRTP is already in use then add the local SSRC to it, otherwise it will get added once DTLS</span><br><span>        * negotiation has been completed.</span><br><span>    */</span><br><span>@@ -7788,7 +7788,7 @@</span><br><span>  return 0;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(0, 100%, 40%);">-#if !defined(OPENSSL_NO_SRTP) && (OPENSSL_VERSION_NUMBER >= 0x10001000L)</span><br><span style="color: hsl(120, 100%, 40%);">+#if defined(HAVE_OPENSSL) && (OPENSSL_VERSION_NUMBER >= 0x10001000L) && !defined(OPENSSL_NO_SRTP)</span><br><span> /*! \pre instance is locked */</span><br><span> static int ast_rtp_activate(struct ast_rtp_instance *instance)</span><br><span> {</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9738">change 9738</a>. To unsubscribe, or for help writing mail filters, visit <a href="https://gerrit.asterisk.org/settings">settings</a>.</p><div itemscope itemtype="http://schema.org/EmailMessage"><div itemscope itemprop="action" itemtype="http://schema.org/ViewAction"><link itemprop="url" href="https://gerrit.asterisk.org/9738"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 15 </div>
<div style="display:none"> Gerrit-MessageType: merged </div>
<div style="display:none"> Gerrit-Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b </div>
<div style="display:none"> Gerrit-Change-Number: 9738 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>
<div style="display:none"> Gerrit-Reviewer: Jenkins2 </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Richard Mudgett <rmudgett@digium.com> </div>