<html>
<body>
<div style="font-family: Verdana, Arial, Helvetica, Sans-Serif;">
<table bgcolor="#f9f3c9" width="100%" cellpadding="8" style="border: 1px #c9c399 solid;">
<tr>
<td>
This is an automatically generated e-mail. To reply, visit:
<a href="https://reviewboard.asterisk.org/r/1533/">https://reviewboard.asterisk.org/r/1533/</a>
</td>
</tr>
</table>
<br />
<p>Ship it!</p>
<pre style="white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Looks good. I'd really like to see tests written that cover this behavior. It looks like you manually tested all of the cases--would that be easy to translate into some testsuite tests? If not, let me know and I'll work on creating them.</pre>
<br />
<div>
<table width="100%" border="0" bgcolor="white" style="border: 1px solid #C0C0C0; border-collapse: collapse; margin: 2px padding: 2px;">
<thead>
<tr>
<th colspan="4" bgcolor="#F0F0F0" style="border-bottom: 1px solid #C0C0C0; font-size: 9pt; padding: 4px 8px; text-align: left;">
<a href="https://reviewboard.asterisk.org/r/1533/diff/3/?file=21749#file21749line14529" style="color: black; font-weight: bold; text-decoration: underline;">/branches/1.8/channels/chan_sip.c</a>
<span style="font-weight: normal;">
(Diff revision 3)
</span>
</th>
</tr>
</thead>
<tbody style="background-color: #e4d9cb; padding: 4px 8px; text-align: center;">
<tr>
<td colspan="4"><pre style="font-size: 8pt; line-height: 140%; margin: 0; ">static void extract_host_from_hostport(char **hostport)</pre></td>
</tr>
</tbody>
<tbody>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">14529</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">                 * But, Asterisk 1.4 and 1.6 have always treated the domain-only</span></pre></td>
</tr>
<tr>
<th bgcolor="#b1ebb0" style="border-right: 1px solid #C0C0C0;" align="right"><font size="2"></font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "></pre></td>
<th bgcolor="#b1ebb0" style="border-left: 1px solid #C0C0C0; border-right: 1px solid #C0C0C0;" align="right"><font size="2">14530</font></th>
<td bgcolor="#c5ffc4" width="50%"><pre style="font-size: 8pt; line-height: 140%; margin: 0; "><span class="cm">                 * uri as a username. We continue the tradition. */</span></pre></td>
</tr>
</tbody>
</table>
<pre style="margin-left: 2em; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">The way I look at it, we don't treat it as a username-only URI, we instead make the policy decision that we allow admins to create accounts named after domains and match a registration from an entity claiming to represent that domain to the user named after that domain.
There really isn't any question as to whether or not it is valid, it is entirely a policy decision.</pre>
</div>
<br />
<p>- Terry</p>
<br />
<p>On November 14th, 2011, 1:51 p.m., wdoekes wrote:</p>
<table bgcolor="#fefadf" width="100%" cellspacing="0" cellpadding="8" style="background-image: url('https://reviewboard.asterisk.org/media/rb/images/review_request_box_top_bg.png'); background-position: left top; background-repeat: repeat-x; border: 1px black solid;">
<tr>
<td>
<div>Review request for Asterisk Developers and Terry Wilson.</div>
<div>By wdoekes.</div>
<p style="color: grey;"><i>Updated Nov. 14, 2011, 1:51 p.m.</i></p>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Description </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">This issue addesses the regression that "sip:username" no longer works as
a REGISTER username.
The changeset does mainly this:
if no username is supplied, we use the domain as the username: <sip:host:port>
effectively becomes <sip:host@host:port>
(My personal preference would be having sip:hostport be rejected for both
register and invites. Especially since sip:username registration had been broken
for quite some time. But there seems to be Digium consensus to keep it. It
was not broken for invites, so here is the re-addition for registers.)
The details of the changeset:
-----------------------------
(A) When registering/inviting, we now disallow an empty domain after the '@'
from-uri BEFORE AFTER
- sip:username@domain OK OK
- sip:username fail OK
- sip:username@ OK fail
- sip:@username fail OK <-- side-effect of parse_uri
(B) When registering, we now check domain ACLs when in place, even when no
domain is supplied:
from-uri BEFORE AFTER
- sip:validuser@validdomain OK OK
- sip:validuser fail fail
- sip:validuser@ OK fail
- sip:validboth fail OK
- sip:validboth@ OK fail
- sip:@validboth fail OK <-- side-effect of parse_uri
(C) When refusing a register with an invalid domain, we send the fake auth
rejection.
(D) The domain is checked for empty in check_user_full() for consistency with
register_verify().
(E) I renamed 'of' to 'name' in check_user_full() for clarity and similarity
with register_verify(). I renamed a couple of 'dummy' variables to
'unused_password' and standardized the variable declarations to the most
common occurrence.</pre>
</td>
</tr>
</table>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Testing </h1>
<table width="100%" bgcolor="#ffffff" cellspacing="0" cellpadding="10" style="border: 1px solid #b8b5a0">
<tr>
<td>
<pre style="margin: 0; padding: 0; white-space: pre-wrap; white-space: -moz-pre-wrap; white-space: -pre-wrap; white-space: -o-pre-wrap; word-wrap: break-word;">Tested the BEFORE and AFTER results when registering and inviting.</pre>
</td>
</tr>
</table>
<div style="margin-top: 1.5em;">
<b style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Bugs: </b>
<a href="https://issues.asterisk.org/jira/browse/ASTERISK-18389">ASTERISK-18389</a>
</div>
<h1 style="color: #575012; font-size: 10pt; margin-top: 1.5em;">Diffs</b> </h1>
<ul style="margin-left: 3em; padding-left: 0;">
<li>/branches/1.8/channels/chan_sip.c <span style="color: grey">(345163)</span></li>
</ul>
<p><a href="https://reviewboard.asterisk.org/r/1533/diff/" style="margin-left: 3em;">View Diff</a></p>
</td>
</tr>
</table>
</div>
</body>
</html>