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

cache password hash in SASL auth #2814

Closed
matej21 opened this issue Sep 16, 2022 · 1 comment · Fixed by #2815
Closed

cache password hash in SASL auth #2814

matej21 opened this issue Sep 16, 2022 · 1 comment · Fixed by #2815

Comments

@matej21
Copy link
Contributor

matej21 commented Sep 16, 2022

In SASL auth handling, Hi function is called for every established connection although the password and hash are same. In my measurements, it takes 10-20ms to calculate the hash with default 4096 iterations. Caching the result of this function would significantly improve performance.
What do you think? I can prepare PR.

@matej21
Copy link
Contributor Author

matej21 commented Sep 16, 2022

Just find out, Hi function can be replaced with crypto.pbkdf2Sync(password, salt, 4096, 32, 'sha256'), which is like 20 times faster..

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 a pull request may close this issue.

1 participant