Subject: [Sip] Header Encoding for WWW-Authenticate

From: "Shyamsundar, Purkayastha (Purkayastha)** CTR **" <[email-masked]>
Date: Fri, 12 May 2006 08:57:20 +0530

According to standard ABNF defined in RFC3261 all the SIP headers are
encoded in such a way the the terminating CRLF characters appear after the
complete header ( that including the header name followed by COLON &
parameters).

However , recently while implementing and testing a UA for registration
procedure with WWW-Authenticate I have noticed that this header is encoded
with CRLF appearing after every header parameter. This happens only with
WWW-Authenticate and not with any other header.

I am testing this UA with a IMS specific implementation ( CSCFs) for
transmission of SMS over SIP . and this has been tested successfully with
some conmmercial SMS clients as well. However in the case of my UA the
parser is failing because I am using the CRLF to seperate the headers and my
parser is treating the individual parameters of WWW-Authenticate as SIP
headers hence failing.

Now my query is wheather the WWW-Authenticate should follow the same
standard ABNF defined for all the SIP headers?
Or is it the case that for IMS specific implementation it is encoded in this
way?

thanks in advance
Shyam

_______________________________________________
Sip mailing list  https://www1.ietf.org/mailman/listinfo/sip
This list is for NEW development of the core SIP Protocol
Use [email-masked] for questions on current sip
Use [email-masked] for new developments on the application of sip

---

From: "Bob Penfield" <[email-masked]>
Date: Fri, 12 May 2006 00:31:00 -0400

Questions like this really belong on the Sip-implementors mailing list
[email-masked]
https://lists.cs.columbia.edu/cucslists/listinfo/sip-implementors

If the line following the CRLF begins with whitespace, that line is a 
continuation of the same header. Section 7.3 of RFC 3261 refers to this:

7.3 Header Fields

   SIP header fields are similar to HTTP header fields in both syntax
   and semantics.  In particular, SIP header fields follow the [H4.2]
   definitions of syntax for the message-header and the rules for
   extending header fields over multiple lines.  However, the latter is
   specified in HTTP with implicit whitespace and folding.  This
   specification conforms to RFC 2234 [10] and uses only explicit
   whitespace and folding as an integral part of the grammar.

cheers,
(-:bob

Robert F. Penfield
Chief Software Architect
Acme Packet, Inc.
71 Third Avenue
Burlington, MA 01803
[email-masked]

----- Original Message ----- 
From: "Shyamsundar, Purkayastha (Purkayastha)** CTR **" 
<[email-masked]>
To: <[email-masked]>
Sent: Thursday, May 11, 2006 11:27 PM
Subject: [Sip] Header Encoding for WWW-Authenticate

---

From: Marco Ambu <[email-masked]>
Date: Fri, 12 May 2006 08:42:37 +0200

> complete header ( that including the header name followed by COLON &
Not true! RFC 3261 - ABNF:
WWW-Authenticate = "WWW-Authenticate" HCOLON challenge ; then CRLF
challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) / other-challenge

so CRLF appears after the "complete header" as in all the other headers 
defined in 3261 (see also the examples in rfc 3261 and 3665).

Example:
WWW-Authenticate: Digest realm="atlanta.example.com", qop="auth", 
nonce="ea9c8e88df84f1cec4341ae6cbe5a359",  opaque="", stale=FALSE, 
algorithm=MD5 // [HERE IS CRLF HEADER LINE TERMINATOR - AFTER CHALLENGE]
> standard ABNF defined for all the SIP headers?
If follows the same standard but is cannot be used as multiple header 
even if is a comma-separated list of values, as described in 7.3.1:

[...] It MUST be possible to combine the multiple
header field rows into one "field-name: field-value" pair, without
changing the semantics of the message, by appending each subsequent
field-value to the first, each separated by a comma. The exceptions
to this rule are the WWW-Authenticate, Authorization, Proxy-
Authenticate, and Proxy-Authorization header fields.

--
Marco Ambu
Abbeynet s.p.a.

---

From: "Nataraju A B" <[email-masked]>
Date: Fri, 12 May 2006 16:23:17 +0530

Comments inline... 

Thanks & Regards,
Nataraju A.B.

-----Original Message-----
From: Marco Ambu [mailto:[email-masked]] 
Sent: Friday, May 12, 2006 12:13 PM
To: Shyamsundar, Purkayastha (Purkayastha)** CTR **
Cc: [email-masked]'
Subject: Re: [Sip] Header Encoding for WWW-Authenticate

Not true! RFC 3261 - ABNF:
WWW-Authenticate = "WWW-Authenticate" HCOLON challenge ; then CRLF
challenge = ("Digest" LWS digest-cln *(COMMA digest-cln)) /
other-challenge

Example:

[ABN] any header can always be folded over multiple lines by inserting a
leading space after CRLF. (As paul mentioned in his earlier mail). The
catch is if we miss the leading SPACE in the new line, lead to syntax
error....
--
Marco Ambu
Abbeynet s.p.a.