aboutsummaryrefslogtreecommitdiffstats
path: root/src/lib/passhash
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib/passhash')
-rw-r--r--src/lib/passhash/bcrypt/bcrypt.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/lib/passhash/bcrypt/bcrypt.cpp b/src/lib/passhash/bcrypt/bcrypt.cpp
index 29bcc9d1b..1d28ddfb4 100644
--- a/src/lib/passhash/bcrypt/bcrypt.cpp
+++ b/src/lib/passhash/bcrypt/bcrypt.cpp
@@ -146,7 +146,10 @@ std::string generate_bcrypt(const std::string& pass,
if(version != 'a' && version != 'b' && version != 'y')
throw Invalid_Argument("Unknown bcrypt version '" + std::string(1, version) + "'");
- return make_bcrypt(pass, unlock(rng.random_vec(16)), work_factor, version);
+
+ std::vector<uint8_t> salt;
+ rng.random_vec(salt, 16);
+ return make_bcrypt(pass, salt, work_factor, version);
}
bool check_bcrypt(const std::string& pass, const std::string& hash)