[Home]

Summary:ASTERISK-28280: chan_sip problem with registration when challenge contains a "domain" field with protocol.
Reporter:Guillaume Genty (Elektordi)Labels:patch
Date Opened:2019-02-08 16:27:58.000-0600Date Closed:
Priority:MajorRegression?
Status:Waiting for Feedback/In ProgressComponents:Channels/chan_sip/Registration
Versions:GIT Frequency of
Occurrence
Constant
Related
Issues:
Environment:Attachments:( 0) ASTERISK-28280.diff
Description:There is a problem in registration challenge-response when the field "domain" is present in the "WWW-Authenticate" challenge header, and contains the protocol.

As Asterisk adds the protocol to the "uri" field of the "Authorization" response header, you can have the protocol two times.

Sample:

SIP/2.0 401 Unauthorized
[...]
WWW-Authenticate: Digest realm="xxxxx",domain="sip:1.1.1.1",nonce="xxxxx",opaque="0",stale=false,algorithm=MD5

REGISTER sip:10.255.7.18 SIP/2.0
[...]
Authorization: Digest username="zzzzz", realm="xxxxx", algorithm=MD5, uri="sip:sip:1.1.1.1", nonce="xxxxx", response="xxxxx", opaque="0"

I know the "domain" field is pretty rare, but I just found it on a "Shoretel Communicator" SIP server (from Mitel).
It causes the response to be ignored and a new challenge to be sent from the server, so Asterisk was unable to register.
I wrote a small patch to check this case, the now the answer is valid and the registration is working.

I also checked in the RFC, the protocol is supposed to be in the domain field: https://tools.ietf.org/html/rfc3261#page-182 (example in chapter 20.44)

I made this patch on branch 13, as I was not able to quickly compile a more recent branch, but a look at the source code shows that the issue is still present in master (even if chan_sip is deprecated now).
Comments:By: Asterisk Team (asteriskteam) 2019-02-08 16:27:58.794-0600

Thanks for creating a report! The issue has entered the triage process. That means the issue will wait in this status until a Bug Marshal has an opportunity to review the issue. Once the issue has been reviewed you will receive comments regarding the next steps towards resolution.

A good first step is for you to review the [Asterisk Issue Guidelines|https://wiki.asterisk.org/wiki/display/AST/Asterisk+Issue+Guidelines] if you haven't already. The guidelines detail what is expected from an Asterisk issue report.

Then, if you are submitting a patch, please review the [Patch Contribution Process|https://wiki.asterisk.org/wiki/display/AST/Patch+Contribution+Process].

Please note that once your issue enters an open state it has been accepted. As Asterisk is an open source project there is no guarantee or timeframe on when your issue will be looked into. If you need expedient resolution you will need to find and pay a suitable developer. Asking for an update on your issue will not yield any progress on it and will not result in a response. All updates are posted to the issue when they occur.

By: Guillaume Genty (Elektordi) 2019-02-08 16:29:24.858-0600

My patch for this bug. (Not sure it is good enough to be submitted)

By: George Joseph (gjoseph) 2019-02-11 09:41:25.010-0600

Go ahead and submit the patch to gerrit.  It's the best way to get feedback and get it merged.

https://wiki.asterisk.org/wiki/display/AST/Code+Review