<p>Benjamin Keith Ford <strong>submitted</strong> this change.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/18436">View Change</a></p><div style="white-space:pre-wrap">Approvals:
Benjamin Keith Ford: Looks good to me, approved; Approved for Submit
Friendly Automation: Verified
</div><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;"><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><div style="white-space:pre-wrap"></div><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/18436">change 18436</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/+/18436"/><meta itemprop="name" content="View Change"/></div></div>
<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: master </div>
<div style="display:none"> Gerrit-Change-Id: I41286a3d35b033ccbfbe4129427a62cb793a86e6 </div>
<div style="display:none"> Gerrit-Change-Number: 18436 </div>
<div style="display:none"> Gerrit-PatchSet: 2 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-MessageType: merged </div>