sipgo icon indicating copy to clipboard operation
sipgo copied to clipboard

SIP headers with folded lines fail to parse.

Open DentonGentry opened this issue 4 months ago • 3 comments

Below is a SIP message where the WWW-Authenticate header uses line folding. It was received from the AT&T Wireless VoWifi server — so, a production service.

SIP/2.0 401 Unauthorized\r\n
Call-ID: 01234567\r\n
Via: SIP/2.0/TCP [::1]:5060;received=::1;branch=z9hG4bK.1;rport=48512\r\n
To: <sip:[email protected]>;tag=abcdef\r\n
From: \"30123456789\" <sip:[email protected]>;tag=abcdef\r\n
CSeq: 1 REGISTER\r\n
Date: Tue, 12 Aug 2025 01:20:52 GMT\r\n
Server: Alcatel-Lucent-HPSS/3.0.3\r\n
WWW-Authenticate: Digest realm=\"one.att.net\",\r\n
   nonce=\"abcdefghijklmnopqrstuvwxyz=\",\r\n
   opaque=\"ALU:abcdefghijklmnopqrstuvwxyz__\",\r\n
   algorithm=AKAv1-MD5,\r\n
   qop=\"auth\"\r\n
Content-Length: 0\r\n
\r\n

Attempting to parse this results in an error, ERROR failed to parse caller=TransportLayer caller=Transport<TCP> error="field name with no value in header: nonce=\"abcdefghijklmnopqrstuvwxyz=\",: EOF on reading line"

I've constructed a test case to demonstrate the failure in https://github.com/DentonGentry/sipgo/tree/dentongentry-line-folding which fails. I haven't developed a fix, just demonstrated the issue in a form which might turn into a test case for a fix.

DentonGentry avatar Aug 12 '25 02:08 DentonGentry