Ethereal-dev: Re: [Ethereal-dev] How to decode or understand WSP Cookie Header?

Note: This archive is from the project's previous web site, ethereal.com. This list is no longer active.

From: "Olivier Biot (Ethereal)" <ethereal@xxxxxxxxxxxxxxx>
Date: Thu, 26 May 2005 23:35:52 +0200
Hi Ziven,

The Cookie headers have not (yet) been implemented in the WSP dissector.

For your information, I once compiled an ABNF description of the WSP headers. From this compilation:

Set-Cookie-value =
Value-length Cookie-version Cookie-name Cookie-val *( Parameter )
[after expansion]
Value-length Version-value Text-string Text-string *( Parameter )

Cookie-version = Version-value
Cookie-name = Text-string
Cookie-val = Text-string

Cookie-value =
Value-length Cookie-version *( Cookie )
[after expansion]
Value-length Version-value *( Uintvar-integer Text-string Text-string [ Text-string [ Text-string ] ] )

Cookie =
Cookie-length Cookie-name Cookie-val [ Cookie-parameters ]
[after expansion]
Uintvar-integer Text-string Text-string [ Text-string [ Text-string ] ]

Cookie-length = Uintvar-integer

Cookie-parameters =
Path [ Domain ]
[after expansion]
Text-string [ Text-string ]

Path = Text-string
Domain = Text-string

For the bytes you sent in your mail, this yields:

c2 : Cookie header
1d : short-len = 0x1d = 30 bytes
Expecting version-value
31 00 : Version="1"
Cookies follow:
 09 : Length of first Cookie = 0x09 = 9 bytes
 First Cookie data: 61 62 63 00  31 32 33 00  00
 Meaning: abc="123";path=""
 10 : Length of second Cookie: 0x10 = 16 bytes
 Second Cookie data: 3b 00  31 30 2e 37 30 2e 31 30 39 2e 31 34 37 00
 Meaning: ;="10.70.109.147"
 [!] This is nonsense: a semicolon is not a valid cookie name!

Hope this helps!

Best regards,

Olivier


----- Original Message ----- From: Yang Zan Feng
To: ethereal-dev@xxxxxxxxxxxx
Sent: Monday, May 23, 2005 7:04 AM
Subject: [Ethereal-dev] How to decode or understand WSP Cookie Header?


Hi, all
Web Server sent a response with Set-Cookie field: Set-Cookie: name=abc; path=/
then the Openwave SDK 6.2.2 WAP sends a request with the Cookie field,
the Cookie field can't be decoded by ethereal.
The Cookie field's HEX format is:
c2 1d 31 00 09 61 62 63 00 31 32 33 00 00 10 3b
00 31 30 2e 37 30 2e 31 30 39 2e 31 34 37 00
Refer to WAP-230-WSP,
Cookie-value = Value-length Cookie-version *Cookie
Cookie = Cookie-length Cookie-name Cookie-val [Cookie-parameters]
Cookie-length = Uintvar-integer
Cookie-parameters= Path [Domain]
Path = Text-string
if path is an empty string, it indicates that there is no path value present.
Domain = Text-string
I can decode the most of this field, but i don't understand what "00 10 3b 00" means.
0x00 may mean that there is no path value present, but 0x10 means what???
Any suggestion will be appreciated.
Best Regards,
Ziven (YangZanfeng)