Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix bugs from recent performance enhancements #70

Merged
merged 2 commits into from
Jul 7, 2024

Conversation

wolfendale
Copy link
Contributor

@wolfendale wolfendale commented Jul 7, 2024

Changes:

As a result of #69 there were some regressions that this PR fixes while maintaining major performance improvements.

  1. One of the changes in the previous PR stopped us from allocating 64 bytes every time we read in a new packet. Unfortunately, that state is later used in other goroutines as various []bytes are stored on the packet that point to the underlying byte array. This PR instead allocates 64 bytes for the workers which read from the UDP stream, but then allocates just enough memory for each packet and copies the read bytes over.

  2. A change to DeriveKerberosKey resulted in a regression for passwords shorter than 16 bytes. While almost all account passwords are 16 bytes as they are generated, the guest key which is hard coded in all NEX consoles uses a 12 byte key. This resulted in people who had not connected to the network before being unable to decrypt the kerberos key and failing to connect. This fix correctly initialises keys for passwords shorter than 16 bytes while retaining all of the performance benefits of the change. I've also added a test to make sure the guest key is generated properly

kerberos.go Outdated Show resolved Hide resolved
@wolfendale wolfendale force-pushed the performance-tweaks branch from 0621d95 to feee2dd Compare July 7, 2024 15:36
@jonbarrow jonbarrow merged commit a035545 into PretendoNetwork:master Jul 7, 2024
@wolfendale wolfendale deleted the performance-tweaks branch July 9, 2024 16:56
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants