<p>Patch set 2:<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/+/14031">View Change</a></p><p>4 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14031/2/include/asterisk/res_stir_shaken.h">File include/asterisk/res_stir_shaken.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/+/14031/2/include/asterisk/res_stir_shaken.h@21">Patch Set #2, Line 21:</a> <code style="font-family:monospace,monospace">#include "asterisk/json.h"</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Move this to the .c file and forward declare ast_json</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14031/2/include/asterisk/res_stir_shaken.h@26">Patch Set #2, Line 26:</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;">struct ast_stir_shaken_payload {<br>  /*! The JWT header */<br> struct ast_json *header;<br>      /*! The JWT payload */<br>        struct ast_json *payload;<br>     /*! Signature for the payload */<br>      unsigned char *signature;<br>     /*! The algorithm used */<br>     char *algorithm;<br>      /*! THe URL to the public key for the certificate */<br>  char *public_key_url;<br>};<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">make this opaque</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14031/2/res/res_stir_shaken/certificate.c">File res/res_stir_shaken/certificate.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/+/14031/2/res/res_stir_shaken/certificate.c@100">Patch Set #2, Line 100:</a> <code style="font-family:monospace,monospace">              return cert->public_key_url;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This seems unsafe unless the cert object lifetime is guaranteed past the return? A pointer to the string is returned, but if the underlying object goes away it will then point to "trash", which will result in a crash (probably).</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14031/2/res/res_stir_shaken/certificate.c@110">Patch Set #2, Line 110:</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;">     cert = get_by_caller_id_number(caller_id_number);<br>     if (cert) {<br>           return cert->private_key;<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Same for this. A pointer is returned, but if the underlying object goes away the sadness.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14031">change 14031</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/+/14031"/><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: I74fa41c0640ab2a64a1a80110155bd7062f13393 </div>
<div style="display:none"> Gerrit-Change-Number: 14031 </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: Friendly Automation </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-CC: Corey Farrell <git@cfware.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 31 Mar 2020 21:27:42 +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>