<p> Attention is currently required from: Joshua Colp, Kevin Harwell, Benjamin Keith Ford. </p>
<p>Patch set 6:<span style="border-radius: 3px; display: inline-block; margin: 0 2px; padding: 4px;background-color: #ffd4d4; color: #000000;">Code-Review -1</span></p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/16497">View Change</a></p><p>3 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="null">File include/asterisk/res_pjsip.h:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16497/comment/585f80c2_284e1ccf">Patch Set #6, Line 516:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">enum ast_sip_stir_shaken_behavior {<br>  /*! Don't do any STIR/SHAKEN operations */<br>        AST_SIP_STIR_SHAKEN_OFF = (1 << 0),<br>     /*! Only do STIR/SHAKEN attestation */<br>        AST_SIP_STIR_SHAKEN_ATTEST = (1 << 1),<br>  /*! Only do STIR/SHAKEN verification */<br>       AST_SIP_STIR_SHAKEN_VERIFY = (1 << 2),<br>  /*! Do STIR/SHAKEN attestation and verification */<br>    AST_SIP_STIR_SHAKEN_ON = (1 << 3),<br>};<br><br>/<br></pre></blockquote></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">I don't think this is right.  I think it should be <br>enum ast_sip_stir_shaken_behavior {<br>        /*! Don't do any STIR/SHAKEN operations */<br>        AST_SIP_STIR_SHAKEN_OFF = 0,<br>  /*! Only do STIR/SHAKEN attestation */<br>        AST_SIP_STIR_SHAKEN_ATTEST = 1,<br>       /*! Only do STIR/SHAKEN verification */<br>       AST_SIP_STIR_SHAKEN_VERIFY = 2,<br>       /*! Do STIR/SHAKEN attestation and verification */<br>    AST_SIP_STIR_SHAKEN_ON = 3,<br>};</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">This way you can do<br>    if (testvalue & AST_SIP_STIR_SHAKEN_ATTEST)<br>or<br>    if (testvalue & AST_SIP_STIR_SHAKEN_VERIFY)</pre><p style="white-space: pre-wrap; word-wrap: break-word;">If you leave them the way they are then AST_SIP_STIR_SHAKEN_ON isn't a bitmap of ATTEST and VERIFY.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_session.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16497/comment/d08ced76_54c759f2">Patch Set #6, Line 4071:</a> </p><p><blockquote style="border-left: 1px solid #aaa; margin: 10px 0; padding: 0 10px;"><pre style="font-family: monospace,monospace; white-space: pre-wrap;">     if ((endpoint->stir_shaken == AST_SIP_STIR_SHAKEN_VERIFY ||<br>                endpoint->stir_shaken == AST_SIP_STIR_SHAKEN_ON) &&<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This is what I mean...  You can reduce this to <br>if (endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_VERIFY )</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="null">File res/res_pjsip_stir_shaken.c:</a></p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/16497/comment/f60a03a8_f376eed1">Patch Set #6, Line 476:</a> <code style="font-family:monospace,monospace">(session->endpoint->stir_shaken & (AST_SIP_STIR_SHAKEN_ATTEST | AST_SIP_STIR_SHAKEN_ON))</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Again, can be reduced to<br>if (session->endpoint->stir_shaken & AST_SIP_STIR_SHAKEN_ATTEST)</p><p style="white-space: pre-wrap; word-wrap: break-word;">You could even create a few macros...</p><p style="white-space: pre-wrap; word-wrap: break-word;">#define AST_STIR_SHAKEN_MUST_VERIFY(option) (option & AST_SIP_STIR_SHAKEN_VERIFY)<br>#define AST_STIR_SHAKEN_MUST_ATTEST(option) (option & AST_SIP_STIR_SHAKEN_ATTEST)</p><p style="white-space: pre-wrap; word-wrap: break-word;">if (AST_STIR_SHAKEN_MUST_ATTEST(session->endpoint->stir_shaken))</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/16497">change 16497</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/+/16497"/><meta itemprop="name" content="View Change"/></div></div>

<div style="display:none"> Gerrit-Project: asterisk </div>
<div style="display:none"> Gerrit-Branch: 16 </div>
<div style="display:none"> Gerrit-Change-Id: I4ac1ecf652cd0e336006b0ca638dc826b5b1ebf7 </div>
<div style="display:none"> Gerrit-Change-Number: 16497 </div>
<div style="display:none"> Gerrit-PatchSet: 6 </div>
<div style="display:none"> Gerrit-Owner: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-Reviewer: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Attention: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Attention: Benjamin Keith Ford <bford@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Thu, 21 Oct 2021 14:51:40 +0000 </div>
<div style="display:none"> Gerrit-HasComments: Yes </div>
<div style="display:none"> Gerrit-Has-Labels: Yes </div>
<div style="display:none"> Gerrit-MessageType: comment </div>