• Welcome to Valhalla Legends Archive.
 

BNLS Password Hash

Started by MyndFyre, September 27, 2003, 06:32 PM

Previous topic - Next topic

MyndFyre

Thanks to your guys' help, I'm almost there!

I'm having a problem getting my password hashed...

When I send BNLS_HASHDATA with params:
(DWORD) 6
(DWORD) DOUBLEHASH
(NonNTString) "mypass"
(DWORD) < my client session key >
(DWORD) < my server session key >

I get an invalid password error on bnet with both SID_LOGINRESPONSE and SID_LOGINRESPONSE2.

When I send a BNLS_HASHDATA with params:
(DWORD) 6
(DWORD) 1 _or_ 0
(NonNTString) "mypass"

I get the expected 20-byte hash data back.  I need to double-hash it, so then I send BNLS_HASHDATA with params:
(DWORD) 20 _or_ 22, same result
(DWORD) 1 _or_ 0
(DWORD[5]) < first hash result >
(DWORD) < my client session key >
(DWORD) < my server session key >

but then I get the same result with BNLS as if Bnet IP bans me - I get disconnected.  What am I doing wrong here?

Thanks!

--Rob
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

MyndFyre

Well, I fixed the second single-hash, but I'm still getting an invalid password.  Thoughts?
QuoteEvery generation of humans believed it had all the answers it needed, except for a few mysteries they assumed would be solved at any moment. And they all believed their ancestors were simplistic and deluded. What are the odds that you are the first generation of humans who will understand reality?

After 3 years, it's on the horizon.  The new JinxBot, and BN#, the managed Battle.net Client library.

Quote from: chyea on January 16, 2009, 05:05 PM
You've just located global warming.

Skywing

#2
You should use this:
(DWORD) Password length
(DWORD) HASHDATA_FLAG_DOUBLEHASH (0x04)
(Variable) Password
(DWORD) Client key
(DWORD) Server key

The HASHDATA_FLAG_DOUBLEHASH option tells BNLS to first create a hash of Password, and then create a hash of Client key + Server key + Hash(Password).  The latter result is returned.  This allows you to combine the common double-hash operation into just one transaction.