<p>Patch set 1:<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/+/14408">View Change</a></p><p>6 comments:</p><ul style="list-style: none; padding: 0;"><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/res/res_stir_shaken.c">File res/res_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/+/14408/1/res/res_stir_shaken.c@1199">Patch Set #1, Line 1199:</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;">static void test_stir_shaken_add_fake_astdb_entry(const char *public_key_url, const char *file_path)<br>{<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This and all the test methods below should be wrapped in a #ifdef TEST_FRAMEWORK check.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/res/res_stir_shaken.c@1254">Patch Set #1, Line 1254:</a> <code style="font-family:monospace,monospace"> return -1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">close the file before returning here.</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/res/res_stir_shaken/certificate.h">File res/res_stir_shaken/certificate.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/+/14408/1/res/res_stir_shaken/certificate.h@57">Patch Set #1, Line 57:</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;">*!<br> * \brief Clean up the certificate and mappings set up in test_stir_shaken_init<br> *<br> * \param caller_id_number The caller ID of the certificate to clean up<br> *<br> * \retval non-zero on failure<br> * \retval 0 on success<br> */<br>int test_stir_shaken_cleanup_cert(const char *caller_id_number);<br><br>/*!<br> * \brief Initialize a test certificate through wizard mappings<br> *<br> * \note test_stir_shaken_cleanup should be called when done with this certificate<br> *<br> * \param caller_id_number The caller ID of the certificate to create<br> * \param file_path The path to the private key for this certificate<br> *<br> * \retval non-zero on failure<br> * \retval 0 on success<br> */<br>int test_stir_shaken_create_cert(const char *caller_id_number, const char *file_path);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">Since test only code wrap this in an #ifdef TEST_FRAMEWORK</p></li></ul></li><li style="margin: 0; padding: 0;"><p><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/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/+/14408/1/res/res_stir_shaken/certificate.c@260">Patch Set #1, Line 260:</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 = stir_shaken_certificate_get_by_caller_id_number(caller_id_number);<br> ao2_cleanup(cert);<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">This doesn't remove it from sorcery. I think you'll still have to call 'ast_sorcery_delete'?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/res/res_stir_shaken/certificate.c@247">Patch Set #1, Line 247:</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;">* Name for test certificaate */<br>#define TEST_CONFIG_NAME "test_stir_shaken_certificate"<br>/* The public key URL to use for the test certificate */<br>#define TEST_CONFIG_URL "http://testing123"<br><br>int test_stir_shaken_cleanup_cert(const char *caller_id_number)<br>{<br> struct stir_shaken_certificate *cert;<br> struct ast_sorcery *sorcery;<br> int res = 0;<br><br> sorcery = ast_stir_shaken_sorcery();<br><br> cert = stir_shaken_certificate_get_by_caller_id_number(caller_id_number);<br> ao2_cleanup(cert);<br><br> res = ast_sorcery_remove_wizard_mapping(sorcery, CONFIG_TYPE, "memory");<br><br> return res;<br>}<br><br>int test_stir_shaken_create_cert(const char *caller_id_number, const char *file_path)<br></pre></blockquote></p><p style="white-space: pre-wrap; word-wrap: break-word;">#ifdef the test stuff.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14408/1/res/res_stir_shaken/certificate.c@296">Patch Set #1, Line 296:</a> <code style="font-family:monospace,monospace"> return -1;</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">free "cert" here before returning.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14408">change 14408</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/+/14408"/><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: I9fa43380f861ccf710cd0f6b6c102a517c86ea13 </div>
<div style="display:none"> Gerrit-Change-Number: 14408 </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-Reviewer: Friendly Automation </div>
<div style="display:none"> Gerrit-Reviewer: Kevin Harwell <kharwell@digium.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Mon, 18 May 2020 23:16:20 +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>