dwin / goArgonPass

goArgonPass is a Argon2 Password utility package for Go using the crypto library package Argon2 designed to be compatible with Passlib for Python and Argon2 PHP. Argon2 was the winner of the most recent Password Hashing Competition. This is designed for use anywhere password hashing and verification might be needed and is intended to replace implementations using bcrypt or Scrypt.
MIT License
18 stars 7 forks source link

when generating salt, return error if any instead of just logging it #2

Closed conradoplg closed 5 years ago

conradoplg commented 5 years ago

Ignoring errors when generating the salt is bad; presently if any errors occurs it will use an empty salt.

I decided not to create a specific error for it because it would mask the original error, and it doesn't seem to be an error that the client could check for and do something about it.

I've also changed the salt generation to the slightly more idiomatic rand.Read.