1
0
Fork 0
mirror of https://github.com/nishiki/manage-password.git synced 2024-10-27 02:33:19 +00:00

fix bug salt in mpw server

This commit is contained in:
nishiki 2014-04-27 15:13:43 +02:00
parent 08fbd25846
commit 7305ecef0f

View file

@ -130,7 +130,7 @@ class Server
hash = gpg_data['gpg']['hash']
else
salt = salt
salt = generate_salt
hash = Digest::SHA256.hexdigest(salt + msg['password'])
end
@ -311,7 +311,7 @@ class Server
# Generate a random salt
# @args: length -> the length salt
# @rtrn: a random string
def salt(length=4)
def generate_salt(length=4)
if length.to_i <= 0 || length.to_i > 16
length = 4
else