<p>Philip Prindeville has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/19106">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">res_crypto: make keys reloadable on demand for testing<br><br>ASTERISK-30045<br><br>Change-Id: If59bbb50c1771084bfe2fef307a6077c90d35ce8<br>---<br>M include/asterisk/crypto.h<br>M res/res_crypto.c<br>2 files changed, 21 insertions(+), 0 deletions(-)<br><br></pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;">git pull ssh://gerrit.asterisk.org:29418/asterisk refs/changes/06/19106/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/include/asterisk/crypto.h b/include/asterisk/crypto.h</span><br><span>index 38c413f..7b889e1 100644</span><br><span>--- a/include/asterisk/crypto.h</span><br><span>+++ b/include/asterisk/crypto.h</span><br><span>@@ -180,6 +180,8 @@</span><br><span> </span><br><span> AST_OPTIONAL_API(int, ast_crypto_loaded, (void), { return 0; });</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+AST_OPTIONAL_API(int, ast_crypto_reload, (void), { return 0; });</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> #if defined(__cplusplus) || defined(c_plusplus)</span><br><span> }</span><br><span> #endif</span><br><span>diff --git a/res/res_crypto.c b/res/res_crypto.c</span><br><span>index 71cc979..19b011d 100644</span><br><span>--- a/res/res_crypto.c</span><br><span>+++ b/res/res_crypto.c</span><br><span>@@ -95,6 +95,8 @@</span><br><span> </span><br><span> static AST_RWLIST_HEAD_STATIC(keys, ast_key);</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+static void crypto_load(int ifd, int ofd);</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> /*!</span><br><span> * \brief setting of priv key</span><br><span> * \param buf</span><br><span>@@ -465,6 +467,12 @@</span><br><span> return 1;</span><br><span> }</span><br><span> </span><br><span style="color: hsl(120, 100%, 40%);">+int AST_OPTIONAL_API_NAME(ast_crypto_reload)(void)</span><br><span style="color: hsl(120, 100%, 40%);">+{</span><br><span style="color: hsl(120, 100%, 40%);">+ crypto_load(-1, -1);</span><br><span style="color: hsl(120, 100%, 40%);">+ return 1;</span><br><span style="color: hsl(120, 100%, 40%);">+}</span><br><span style="color: hsl(120, 100%, 40%);">+</span><br><span> int AST_OPTIONAL_API_NAME(ast_aes_set_encrypt_key)(const unsigned char *key, ast_aes_encrypt_key *ctx)</span><br><span> {</span><br><span> return AES_set_encrypt_key(key, 128, ctx);</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/19106">change 19106</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/+/19106"/><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: If59bbb50c1771084bfe2fef307a6077c90d35ce8 </div>
<div style="display:none"> Gerrit-Change-Number: 19106 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: Philip Prindeville <philipp@redfish-solutions.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>