[JDEV] digest authentication
Dustin Puryear
dpuryear at usa.net
Mon May 21 12:18:36 CDT 2001
Thomas Muldowney wrote:
>
> What does it spit out at you and with what data?
Okay, I'll just give you the shahash() data. If it's right, and I don't
see why not, then perhaps I am doing something else wrong. First, here
is the driver I added to sha.c:
#ifdef SHA_DRIVER
#include <string.h>
int main(int argc, char *argv[])
{
char buf[1024];
if (argc < 2)
return 1;
strcpy(buf, argv[1]);
strcat(buf, argv[2]);
printf("buf = %s\n", buf);
printf("shahash(%s) = %s\n", buf, shahash(buf));
return 0;
}
#endif
So, an example would be:
./a.out 3B094D98 password
buf = 3B094D98password
shahash(3B094D98password) = f5dc79b8fec961496e44b7a7e70f073391ea23f1
Is that correct output? It differs from Gabber's. I am taking 3B094D98
from the "id" returned after establishing a stream. Hmm, just in case
this helps. Here is the output from Gabber:
20010521T17:15:07<<< <stream:stream to='
20010521T17:15:07<<< jabber.org
20010521T17:15:07<<< ' xmlns='jabber:client'
xmlns:stream='http://etherx.jabber.org/streams'>
20010521T17:15:07>>> <?xml version='1.0'?><stream:stream
xmlns:stream='http://etherx.jabber.org/streams' id='3B094D98'
xmlns='jabber:client' from='jabber.org'>
20010521T17:15:07<<< <iq id='A0' type='get'><query
xmlns='jabber:iq:auth'><username>dpuryear</username></query></iq>
20010521T17:15:08>>> <iq id='A0' type='result'><query
xmlns='jabber:iq:auth'><username>dpuryear</username><password/><digest/><sequence>326</sequence><token>3A7B471C</token><resource/></query></iq>
20010521T17:15:08<<< <iq id='A1' type='set'><query
xmlns='jabber:iq:auth'><username>dpuryear</username><resource>Work</resource><hash>7c20f0d1f908f4c284fb3f52b364bbbe8222da81</hash></query></iq>
Despite me using a phoney password, I know that Gabber is producing
proper output since I can login using the correct password.
Regards, Dustin
--
Dustin Puryear <dpuryear at usa.net>
http://members.telocity.com/~dpuryear
In the beginning the Universe was created.
This has been widely regarded as a bad move. - Douglas Adams
More information about the JDev
mailing list