"WWW-Authenticate"-line contains two whitespaces?

MG
Martin Gross
Thu, May 24, 2018 1:27 PM

Hello everyone,

Yesterday I decided to upgrade my asterisk-setup at home and install it
with Asterisk 15.4.0 which comes bundled with pjsip 2.7.2

Incoming registrations work just fine with most for most of my clients -
except a (admittedly quite old) Patton mATA.

For further investigation, I enabled to the debug-output and found the
following: https://pastebin.com/raw/nCssPuCm

As you can see, the device is sending the REGISTER and gets the 401
returned - but then nothing more happens.

It took me some time, but I then realized, that there are two whitespaces
in between "WWW-Authenticate: Digest" and "realm=".

I tried patching around a little bit and realized at some point, that those
two whitespaces seem to screw up the device. As soon as those two
whitespaces are just one whitespace, the mATA sends a new REGISTER with the
proper authentication.

Unfortunately, I was not able to locate the proper part of the pjsip-source
where this double whitespace is introduced - so I am writing this message,
hopeing that someone more knowledgeable can fix this.

I didn't report this bug to Asterisk as this seems (to me) like a
pjsip-bug. If this assessment is wrong, please let me know and I'll report
it somewhere else :-)

Best regards,
Martin

Hello everyone, Yesterday I decided to upgrade my asterisk-setup at home and install it with Asterisk 15.4.0 which comes bundled with pjsip 2.7.2 Incoming registrations work just fine with most for most of my clients - except a (admittedly quite old) Patton mATA. For further investigation, I enabled to the debug-output and found the following: https://pastebin.com/raw/nCssPuCm As you can see, the device is sending the REGISTER and gets the 401 returned - but then nothing more happens. It took me some time, but I then realized, that there are two whitespaces in between "WWW-Authenticate: Digest" and "realm=". I tried patching around a little bit and realized at some point, that those two whitespaces seem to screw up the device. As soon as those two whitespaces are just one whitespace, the mATA sends a new REGISTER with the proper authentication. Unfortunately, I was not able to locate the proper part of the pjsip-source where this double whitespace is introduced - so I am writing this message, hopeing that someone more knowledgeable can fix this. I didn't report this bug to Asterisk as this seems (to me) like a pjsip-bug. If this assessment is wrong, please let me know and I'll report it somewhere else :-) Best regards, Martin
AG
Alexei Gradinari
Thu, May 24, 2018 2:37 PM

Re: [pjsip] "WWW-Authenticate"-line contains two whitespaces?  Hello Martin,

Attached the PJSIP patch which should fix this issue.

Nanang,
Could you, please, commit this patch.

Regards,
Alexei

Thursday, May 24, 2018, 9:27:00 AM, you wrote:

Hello everyone,

Yesterday I decided to upgrade my asterisk-setup at home and install it with Asterisk 15.4.0 which comes bundled with pjsip 2.7.2

Incoming registrations work just fine with most for most of my clients - except a (admittedly quite old) Patton mATA.

For further investigation, I enabled to the debug-output and found the following: https://pastebin.com/raw/nCssPuCm

As you can see, the device is sending the REGISTER and gets the 401 returned - but then nothing more happens.

It took me some time, but I then realized, that there are two whitespaces in between "WWW-Authenticate: Digest" and "realm=".

I tried patching around a little bit and realized at some point, that those two whitespaces seem to screw up the device. As soon as those two whitespaces are just one whitespace, the mATA sends a new REGISTER with the proper authentication.

Unfortunately, I was not able to locate the proper part of the pjsip-source where this double whitespace is introduced - so I am writing this message, hopeing that someone more knowledgeable can fix this.

I didn't report this bug to Asterisk as this seems (to me) like a pjsip-bug. If this assessment is wrong, please let me know and I'll report it somewhere else :-)

Best regards,
Martin
 

MG
Martin Gross
Thu, May 24, 2018 3:19 PM

Hello Alexei,

thank you very much for the patch - it's working almost perfectly :-)

The only change I added, is to decrease the length-int to also reflect the
change you made.

Best regards,
Martin

2018-05-24 16:37 GMT+02:00 Alexei Gradinari alex2grad@gmail.com:

Hello Martin,

Attached the PJSIP patch which should fix this issue.

Nanang,
Could you, please, commit this patch.

Regards,
Alexei

Thursday, May 24, 2018, 9:27:00 AM, you wrote:

Hello everyone,

Yesterday I decided to upgrade my asterisk-setup at home and install it
with Asterisk 15.4.0 which comes bundled with pjsip 2.7.2

Incoming registrations work just fine with most for most of my clients -
except a (admittedly quite old) Patton mATA.

For further investigation, I enabled to the debug-output and found the
following: https://pastebin.com/raw/nCssPuCm

As you can see, the device is sending the REGISTER and gets the 401
returned - but then nothing more happens.

It took me some time, but I then realized, that there are two whitespaces
in between "WWW-Authenticate: Digest" and "realm=".

I tried patching around a little bit and realized at some point, that
those two whitespaces seem to screw up the device. As soon as those two
whitespaces are just one whitespace, the mATA sends a new REGISTER with the
proper authentication.

Unfortunately, I was not able to locate the proper part of the
pjsip-source where this double whitespace is introduced - so I am writing
this message, hopeing that someone more knowledgeable can fix this.

I didn't report this bug to Asterisk as this seems (to me) like a
pjsip-bug. If this assessment is wrong, please let me know and I'll report
it somewhere else :-)

Best regards,
Martin

alex2grad@gmail.com

Hello Alexei, thank you very much for the patch - it's working almost perfectly :-) The only change I added, is to decrease the length-int to also reflect the change you made. Best regards, Martin 2018-05-24 16:37 GMT+02:00 Alexei Gradinari <alex2grad@gmail.com>: > Hello Martin, > > Attached the PJSIP patch which should fix this issue. > > Nanang, > Could you, please, commit this patch. > > Regards, > Alexei > > > Thursday, May 24, 2018, 9:27:00 AM, you wrote: > > Hello everyone, > > Yesterday I decided to upgrade my asterisk-setup at home and install it > with Asterisk 15.4.0 which comes bundled with pjsip 2.7.2 > > Incoming registrations work just fine with most for most of my clients - > except a (admittedly quite old) Patton mATA. > > For further investigation, I enabled to the debug-output and found the > following: https://pastebin.com/raw/nCssPuCm > > As you can see, the device is sending the REGISTER and gets the 401 > returned - but then nothing more happens. > > It took me some time, but I then realized, that there are two whitespaces > in between "WWW-Authenticate: Digest" and "realm=". > > I tried patching around a little bit and realized at some point, that > those two whitespaces seem to screw up the device. As soon as those two > whitespaces are just one whitespace, the mATA sends a new REGISTER with the > proper authentication. > > Unfortunately, I was not able to locate the proper part of the > pjsip-source where this double whitespace is introduced - so I am writing > this message, hopeing that someone more knowledgeable can fix this. > > I didn't report this bug to Asterisk as this seems (to me) like a > pjsip-bug. If this assessment is wrong, please let me know and I'll report > it somewhere else :-) > > Best regards, > Martin > > <alex2grad@gmail.com> >