<html>
Hi...<br><br>
I just released a new version of Muse Jabber API. Hopefully some of
you are willing to try and test it for me.. This new release boasts
support for <font face="Verdana">XML-RPC and JabberRPC, jabber:iq:time,
jabber:iq:version, jabber:iq:last, jabber:x:delay, jabber:x:roster,
jabber:x:event, and jabber:x:expire.<br><br>
<a href="http://www.echomine.org/projects/muse/" eudora="autourl">http://www.echomine.org/projects/muse/</a><br><br>
</font>Aside from my shameless plug for my API, I do have an issue
regarding the 0K authentication implementation.<br><br>
I've been trying to implement 0k authentication in Java and I have no yet
gotten it to work.. I followed the docs to the dot (and even strayed away
from it just to be adventurous and lucky), but the Hash that I'm
generating still doesn't correspond to the Hash that should be sent to
the server.<br><br>
I'm rather confused... Not only that, the 0k authentication draft
document doesn't specify exactly what the payload looks like to set/reset
the 0k authentication.<br><br>
Here's a snippet of my algorithm code that generates the the hash.. any
help is appreciated..<br><br>
protected String
getZeroKnowledgePassword(JabberContext context, String zerokToken, int
zerokSeq) {<br>
//cache hash so no need to go
through calculation again<br>
if (hash != null) return
hash;<br>
//instantiate a SHA1
hash<br>
try {<br>
MessageDigest md = MessageDigest.getInstance("SHA");<br>
//hash
password first<br>
md.update(context.getPassword().getBytes());<br>
byte[]
hashA = md.digest();<br>
//now
hash hashA + zerokToken<br>
md.reset();<br>
md.update(HexDec.convertBytesToHexString(hashA).toLowerCase().getBytes());<br>
md.update(zerokToken.getBytes());<br>
byte[]
hash0 = md.digest();<br>
byte[]
hashSeq = new byte[hash0.length];<br>
System.arraycopy(hash0, 0, hashSeq, 0, hash0.length);<br>
for
(int i = 0; i < (zerokSeq - 1); i++) {<br>
md.reset();<br>
//just start hashing<br>
hashSeq = md.digest(hashSeq);<br>
}<br>
//convert to hex representation<br>
hash =
HexDec.convertBytesToHexString(hashSeq);<br>
} catch
(NoSuchAlgorithmException ex) {<br>
return
"";<br>
}<br>
return hash;<br>
}<br><br>
<br>
Thanks,<br>
Chris<br>
<x-sigsep><p></x-sigsep>
PGP at ldap://certserver.pgp.com/<br>
</html>