<p>George Joseph has uploaded this change for <strong>review</strong>.</p><p><a href="https://gerrit.asterisk.org/c/asterisk/+/15387">View Change</a></p><pre style="font-family: monospace,monospace; white-space: pre-wrap;">chan_iax2.c: Require secret if encryption is enabled<br><br>If there's no secret specified for an iax2 peer and<br>there's no secret specified in the dial string,<br>Asterisk will crash if the authentication method is<br>either plaintext or md5 AND encryption is enabled<br>for the call.  There's a check now to cancel the<br>call if that happens.<br><br>ASTERISK-29624<br>Reported by: N A<br><br>Change-Id: I5928e16137581f7d383fcc7fa04ad96c919e6254<br>---<br>M channels/chan_iax2.c<br>1 file changed, 7 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/87/15387/1</pre><pre style="font-family: monospace,monospace; white-space: pre-wrap;"><span>diff --git a/channels/chan_iax2.c b/channels/chan_iax2.c</span><br><span>index b560065..908daf0 100644</span><br><span>--- a/channels/chan_iax2.c</span><br><span>+++ b/channels/chan_iax2.c</span><br><span>@@ -4589,6 +4589,7 @@</span><br><span>  struct iax2_codec_pref prefs;</span><br><span>        int maxtime;</span><br><span>         int encmethods;</span><br><span style="color: hsl(120, 100%, 40%);">+       int authmethods;</span><br><span>     int found;</span><br><span>   int sockfd;</span><br><span>  int adsi;</span><br><span>@@ -4664,6 +4665,7 @@</span><br><span>    cai->maxtime = peer->maxms;</span><br><span>    cai->capability = peer->capability;</span><br><span>    cai->encmethods = peer->encmethods;</span><br><span style="color: hsl(120, 100%, 40%);">+     cai->authmethods = peer->authmethods;</span><br><span>  cai->sockfd = peer->sockfd;</span><br><span>    cai->adsi = peer->adsi;</span><br><span>        cai->prefs = peer->prefs;</span><br><span>@@ -5118,6 +5120,11 @@</span><br><span>             ast_channel_hangupcause_set(c, AST_CAUSE_BEARERCAPABILITY_NOTAVAIL);</span><br><span>                 return -1;</span><br><span>   }</span><br><span style="color: hsl(120, 100%, 40%);">+     if (cai.encmethods && ast_strlen_zero(cai.secret) && ast_strlen_zero(pds.password) &&</span><br><span style="color: hsl(120, 100%, 40%);">+         ((cai.authmethods & IAX_AUTH_MD5) || (cai.authmethods & IAX_AUTH_PLAINTEXT))) {</span><br><span style="color: hsl(120, 100%, 40%);">+               ast_log(LOG_WARNING, "Call terminated. No secret given and encryption enabled\n");</span><br><span style="color: hsl(120, 100%, 40%);">+          return -1;</span><br><span style="color: hsl(120, 100%, 40%);">+    }</span><br><span>    if (ast_strlen_zero(cai.secret) && ast_test_flag64(iaxs[callno], IAX_FORCE_ENCRYPT)) {</span><br><span>               ast_log(LOG_WARNING, "Call terminated. No secret given and force encrypt enabled\n");</span><br><span>              return -1;</span><br><span></span><br></pre><p>To view, visit <a href="https://gerrit.asterisk.org/c/asterisk/+/15387">change 15387</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/+/15387"/><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: I5928e16137581f7d383fcc7fa04ad96c919e6254 </div>
<div style="display:none"> Gerrit-Change-Number: 15387 </div>
<div style="display:none"> Gerrit-PatchSet: 1 </div>
<div style="display:none"> Gerrit-Owner: George Joseph <gjoseph@digium.com> </div>
<div style="display:none"> Gerrit-MessageType: newchange </div>