[jdev] ruby xmppd, and Psi

Eric Will rakaur at malkier.net
Thu Sep 18 09:34:45 CDT 2008


On Thu, Sep 18, 2008 at 10:11 AM, Norman Rasmussen
<norman at rasmussen.co.za> wrote:
> cnonce should be an opaque blob as far as clients are concerned, (my guess
> is psi is pulling random bytes and base64 encoding them)
> Any chance we can get a log with a known (to us), password?

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)
        v.gsub!(/^"/, '')
        v.gsub!(/"$/, '')

        response[k] = v

    end

And it now works successfully. Sorry to bother you with my screw ups.
Thanks for the help

--
Eric Will



More information about the JDev mailing list