[jdev] ruby xmppd, and Psi

Maciek Niedzielski machekku at uaznia.net
Thu Sep 18 09:36:08 CDT 2008


Eric Will wrote:
> I found my problem. As I figured, it was my fault. I hadn't counted on
> cnonce being base64-encoded, and in my code that forms the `response`
> hash I use, I split the string into key=>value by splitting on the '='
> sign. The cnonce had an '=' on the end of it, which was just getting
> lopped off. I've fixed this with:
> 
>     resp = Base64.decode64(elem.text)
>     resp = resp.split(',')
> 
>     response = {}
>     resp.each do |kv|
>         k, v = kv.split('=')
>         v += '=' if kv[-2].chr == '=' # Some clients base64-encode
> 'cnonce' (ahem, Psi)

But if cnonce can be anything, it can also be something like 
"c=n=o=n=c=e", and then your code still fails ;)

-- 
Maciek
  xmpp:machekku at uaznia.net



More information about the JDev mailing list