Merge pull request #2554 from heinrich5991/pr_ddnet_fix_token

Fix the same token being generated for each client
This commit is contained in:
Dennis Felsing 2020-08-10 23:46:03 +02:00 committed by GitHub
commit d44d596458
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -147,7 +147,7 @@ SECURITY_TOKEN CNetServer::GetToken(const NETADDR &Addr)
SHA256_CTX Sha256;
sha256_init(&Sha256);
sha256_update(&Sha256, (unsigned char*)m_SecurityTokenSeed, sizeof(m_SecurityTokenSeed));
sha256_update(&Sha256, (unsigned char*)&Addr, sizeof(20)); //omit port, bad idea?
sha256_update(&Sha256, (unsigned char*)&Addr, 20); // omit port, bad idea!
SECURITY_TOKEN SecurityToken = ToSecurityToken(sha256_finish(&Sha256).data);