summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-02 15:09:36 +0000
committerakr <akr@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2013-04-02 15:09:36 +0000
commitc3c4ffa9725947a1c150880502399c3309a4fb31 (patch)
tree4b328fb0a70c28799712413f401237a3a72a8bcb
parent90e588777f9634821739526941fa9692c0065bc7 (diff)
* 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
-rw-r--r--ChangeLog7
-rw-r--r--lib/securerandom.rb2
2 files changed, 8 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index 77ea992905..048199595f 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -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.
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index 0127838b00..227a6189c4 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -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)