DIGEST-MD5 challenge/response parsing must handle linear white spaces after the comma

Description

From #smack:

2015-03-31 00:54:34 Pursuit anywho, has anyone tried connecting to a jabberd2 server? I get nonce errors with digest-md5 and I think it's due to the challenge parsing logic
2015-03-31 00:56:05 Pursuit The challenge that jabberd is sending looks like ...", nonce="gNqCRQs6PgY46LbZ/hQ7sw==", qop=" and I think the spaces are throwing it off
2015-03-31 00:57:02 Pursuit since all it's doing is splitting it on ",", the key for each field will have a space in front, and not get matched by the if ("nonce".equals(key))... checks

From RFC 2831

#rule
A construct "#" is defined, similar to "*", for defining lists of
elements. The full form is "<n>#<m>element" indicating at least
<n> and at most <m> elements, each separated by one or more commas
(",") and OPTIONAL linear white space (LWS)

Seems like a good placed trim() should do the trick

Environment

None

Activity

Fixed

Details

Assignee

Reporter

Labels

Expected Effort

Components

Fix versions

Affects versions

Priority

Created March 31, 2015 at 7:41 AM
Updated May 9, 2015 at 1:13 PM
Resolved May 9, 2015 at 1:13 PM