smarkets / erlang-bcrypt

Erlang wrapper for OpenBSD's Blowfish password hashing code
Other
86 stars 47 forks source link

This change makes bcrypt_nif thread safe #8

Closed russor closed 11 years ago

russor commented 11 years ago

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 commented 11 years ago

Sorry, I didn't intend to request all of the commits... only meant to request you pull https://github.com/russor/erlang-bcrypt/commit/336adb74fea7c1c18d463347882f4050aa35890b

Will try to re-create pull request correctly or edit this one.