mirror of
https://github.com/nishiki/manage-password.git
synced 2025-02-17 08:30:04 +00:00
fix bug salt in mpw server
This commit is contained in:
parent
08fbd25846
commit
7305ecef0f
1 changed files with 2 additions and 2 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Reference in a new issue