<p>Benjamin Keith Ford has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18438">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_pjsip_stir_shaken.c: Fix enabled when not configured.<br><br>There was an issue with the conditional where STIR/SHAKEN would be<br>enabled even when not configured. It has been changed to ensure that if<br>a profile does not exist and stir_shaken is not set in pjsip.conf, then<br>the conditional will return from the function without performing<br>STIR/SHAKEN operations.<br><br>ASTERISK-30024<br><br>Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6<br>---<br>M res/res_pjsip_stir_shaken.c<br>1 file changed, 12 insertions(+), 2 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/38/18438/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/res/res_pjsip_stir_shaken.c b/res/res_pjsip_stir_shaken.c</span><br><span>index 19e846f..82c8df0 100644</span><br><span>--- a/res/res_pjsip_stir_shaken.c</span><br><span>+++ b/res/res_pjsip_stir_shaken.c</span><br><span>@@ -225,8 +225,13 @@</span><br><span>        }</span><br><span> </span><br><span>        profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile);</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Profile should be checked first as it takes priority over anything else.</span><br><span style="color: hsl(120, 100%, 40%);">+    * If there is a profile and it doesn't have verification enabled, do nothing.</span><br><span style="color: hsl(120, 100%, 40%);">+     * If there is no profile and the stir_shaken option is either not set or does</span><br><span style="color: hsl(120, 100%, 40%);">+         * not support verification, do nothing.</span><br><span style="color: hsl(120, 100%, 40%);">+       */</span><br><span>  if ((profile && !ast_stir_shaken_profile_supports_verification(profile))</span><br><span style="color: hsl(0, 100%, 40%);">-                && ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          || (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY) == 0)) {</span><br><span>             return 0;</span><br><span>    }</span><br><span> </span><br><span>@@ -478,8 +483,13 @@</span><br><span>         RAII_VAR(struct stir_shaken_profile *, profile, NULL, ao2_cleanup);</span><br><span> </span><br><span>      profile = ast_stir_shaken_get_profile(session->endpoint->stir_shaken_profile);</span><br><span style="color: hsl(120, 100%, 40%);">+  /* Profile should be checked first as it takes priority over anything else.</span><br><span style="color: hsl(120, 100%, 40%);">+    * If there is a profile and it doesn't have attestation enabled, do nothing.</span><br><span style="color: hsl(120, 100%, 40%);">+      * If there is no profile and the stir_shaken option is either not set or does</span><br><span style="color: hsl(120, 100%, 40%);">+         * not support attestation, do nothing.</span><br><span style="color: hsl(120, 100%, 40%);">+        */</span><br><span>  if ((profile && !ast_stir_shaken_profile_supports_attestation(profile))</span><br><span style="color: hsl(0, 100%, 40%);">-         && ((session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) {</span><br><span style="color: hsl(120, 100%, 40%);">+          || (!profile && (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST) == 0)) {</span><br><span>             return;</span><br><span>      }</span><br><span> </span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18438">change 18438</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/c/asterisk/+/18438"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 18.11 </div>
<div style="display:none"> Gerrit-Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6 </div>
<div style="display:none"> Gerrit-Change-Number: 18438 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>