Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // Store sessionkey
- m_account->SetSessionKey(m_sessionkey.AsByteArray());
- // Hash the session key so that the logon DB can know
- int HASH_CONSTANT = 0x7A0Bh;
- const char* temp = m_sessionkey.AsHexStr();
- SHA1_CONTEXT sha_context;
- SHA1_Init(&sha_context);
- SHA1_Update(&sha_context, temp, 40);
- SHA1_Update(&sha_context, &HASH_CONSTANT, 2);
- char keyhash[24];
- SHA1_Final(keyhash, &sha_context);
- // Let the DB know
- sLogonSQL->Execute("UPDATE `account_messages` SET `hash` = '%s' WHERE `account` = '%s';", m_sessionkey.AsDecStr(), m_account->UsernamePtr);
- // let the client know
- sha.Initialize();
- sha.UpdateBigNumbers(&A, &M, &m_sessionkey, 0);
- sha.Finalize();
- SendProofError(0, sha.GetDigest());
- LOG_DEBUG("[AuthLogonProof] Authentication Success.");
Advertisement
Add Comment
Please, Sign In to add comment