<p style="white-space: pre-wrap; word-wrap: break-word;">I'm somewhat confused by the need for astdb. We assemble the path to the key from ast_config_AST_DATA_DIR, STIR_SHAKEN_DIR_NAME and the URL when we save the key, why can't we do the same to retrieve the key instead of storing it in the astdb?<br></p><p>Patch set 3:<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/+/14220">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/+/14220/3/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/+/14220/3/res/res_stir_shaken.c@130">Patch Set #3, Line 130:</a> <code style="font-family:monospace,monospace">static size_t curl_header_callback(char *buffer, size_t size, size_t nitems, void *data)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">Move curl stuff to it's own file in res/res_stir_shaken/ maybe?</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14220/3/res/res_stir_shaken.c@343">Patch Set #3, Line 343:</a> <code style="font-family:monospace,monospace">static char *get_filename_from_url(const char *url)</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">basename() should work.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14220/3/res/res_stir_shaken.c@531">Patch Set #3, Line 531:</a> <code style="font-family:monospace,monospace"> snprintf(stir_shaken_dir, sizeof(stir_shaken_dir), "%s/%s", ast_config_AST_DATA_DIR, STIR_SHAKEN_DIR_NAME);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">We already have /var/lib/asterisk/keys. Should this be a subdirectory of that? We already create "keys" in the top-level Makefile. If you want to keep stir_shaken_keys a direct child of /var/lib/asterisk, then the creation should also be in the Makefile rather than code. Either way, an UPGRADE entry should also be created to notify packagers that a new directory has been created.</p></li><li style="margin: 0; padding: 0 0 0 16px;"><p style="margin-bottom: 4px;"><a href="https://gerrit.asterisk.org/c/asterisk/+/14220/3/res/res_stir_shaken.c@532">Patch Set #3, Line 532:</a> <code style="font-family:monospace,monospace"> ast_mkdir(stir_shaken_dir, 0777);</code></p><p style="white-space: pre-wrap; word-wrap: break-word;">This should at least disallow others from writing (775). Is there any sensitive data in there? private keys? If so, then it'd need to be 770.</p></li></ul></li></ul><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/14220">change 14220</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/+/14220"/><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: I3ba4c63880493bf8c7d17a9cfca1af0e934d1a1c </div>
<div style="display:none"> Gerrit-Change-Number: 14220 </div>
<div style="display:none"> Gerrit-PatchSet: 3 </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-CC: Joshua Colp <jcolp@sangoma.com> </div>
<div style="display:none"> Gerrit-Comment-Date: Tue, 21 Apr 2020 15:17:38 +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>