We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent beac837 commit b412ca0Copy full SHA for b412ca0
lib/net/ldap/password.rb
@@ -27,7 +27,7 @@ def generate(type, str)
27
when :sha
28
attribute_value = '{SHA}' + Base64.encode64(Digest::SHA1.digest(str)).chomp!
29
when :ssha
30
- srand; salt = (rand * 1000).to_i.to_s
+ srand; salt = SecureRandom.random_bytes(16)
31
attribute_value = '{SSHA}' + Base64.encode64(Digest::SHA1.digest(str + salt) + salt).chomp!
32
else
33
raise Net::LDAP::HashTypeUnsupportedError, "Unsupported password-hash type (#{type})"
0 commit comments