mirror of
https://github.com/ruby/ruby.git
synced 2022-11-09 12:17:21 -05:00
* lib/securerandom.rb (SecureRandom.random_bytes): Use
OpenSSL::Random.random_add instead of OpenSSL::Random.seed and specify 0.0 as the entropy. [ruby-core:47308] [Bug #6928] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40072 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
This commit is contained in:
parent
90e588777f
commit
c3c4ffa972
2 changed files with 8 additions and 1 deletions
|
@ -1,3 +1,10 @@
|
|||
Tue Apr 2 23:56:03 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* lib/securerandom.rb (SecureRandom.random_bytes): Use
|
||||
OpenSSL::Random.random_add instead of OpenSSL::Random.seed and
|
||||
specify 0.0 as the entropy.
|
||||
[ruby-core:47308] [Bug #6928]
|
||||
|
||||
Tue Apr 2 20:24:52 2013 Tanaka Akira <akr@fsij.org>
|
||||
|
||||
* pack.c: Support Q! and q! for long long.
|
||||
|
|
|
@ -62,7 +62,7 @@ module SecureRandom
|
|||
if @pid != pid
|
||||
now = Time.now
|
||||
ary = [now.to_i, now.nsec, @pid, pid]
|
||||
OpenSSL::Random.seed(ary.join("").to_s)
|
||||
OpenSSL::Random.random_add(ary.join("").to_s, 0.0)
|
||||
@pid = pid
|
||||
end
|
||||
return OpenSSL::Random.random_bytes(n)
|
||||
|
|
Loading…
Add table
Reference in a new issue