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

This change makes bcrypt_nif thread safe #9

Closed
wants to merge 2 commits into from

Conversation

russor
Copy link

@russor russor commented Nov 13, 2012

Without it, multiple threads calling to bcrypt_nif can result in bad hashes coming back. If you're lucky, you'll get nulls in unexpected places and attempts to verify the hash will get a bcrypt failure; if you're not, you'll get a syntactically valid but incorrect hash back.

I'm using bcyrpt_nif directly, not using the worker interface. If you're using the worker interface you should be OK, because it only does one bcrypt at a time.

@russor
Copy link
Author

russor commented Jun 12, 2013

Fix a leak of a 64 bytes binary per call to bcrypt_nif:gen_salt

@jstasiak
Copy link

Hi @russor, thank you for the contribution and apologies for the delay in getting back to you. The first part is taken care of by 645b00e (originally chef@645b00e) now.

The memory leak patch I cherry-picked and pushed to master as 1039875, thanks!

@jstasiak jstasiak closed this Sep 19, 2015
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.

2 participants