<p>Alexander Traud has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/9739">View Change</a></p><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, 18 insertions(+), 18 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/39/9739/1</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 d101fcb..6f7e09e 100644</span><br><span>--- a/res/res_rtp_asterisk.c</span><br><span>+++ b/res/res_rtp_asterisk.c</span><br><span>@@ -270,7 +270,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>@@ -393,7 +393,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>@@ -470,7 +470,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>@@ -524,7 +524,7 @@</span><br><span> static int ast_rtp_qos_set(struct ast_rtp_instance *instance, int tos, int cos, const char* desc);</span><br><span> static int ast_rtp_sendcng(struct ast_rtp_instance *instance, int level);</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>@@ -1543,7 +1543,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>@@ -1999,13 +1999,13 @@</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> };</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>@@ -2066,7 +2066,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> dtls_perform_handshake(instance, &rtp->dtls, 0);</span><br><span> </span><br><span> if (rtp->rtcp && rtp->rtcp->type == AST_RTP_INSTANCE_RTCP_STANDARD) {</span><br><span>@@ -2197,7 +2197,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>@@ -2521,7 +2521,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>@@ -3225,7 +3225,7 @@</span><br><span> /* Record any information we may need */</span><br><span> rtp->sched = sched;</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>@@ -3246,7 +3246,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>@@ -5861,7 +5861,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>@@ -5924,7 +5924,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>@@ -5944,7 +5944,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>@@ -5972,7 +5972,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>@@ -6234,7 +6234,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>@@ -6329,7 +6329,7 @@</span><br><span> return res;</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> 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></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/9739">change 9739</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/9739"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 13 </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>
<div style="display:none"> Gerrit-Change-Id: Ia68a4cd5474b26d45e0f43b04032ad598022853b </div>
<div style="display:none"> Gerrit-Change-Number: 9739 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Alexander Traud <pabstraud@compuserve.com> </div>