summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog6
-rw-r--r--lib/securerandom.rb2
2 files changed, 7 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index e056a92f29..e418ab2916 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Fri Jul 29 23:56:32 2011 Tanaka Akira <akr@fsij.org>
+
+ * lib/securerandom.rb: call OpenSSL::Random.seed at the
+ SecureRandom.random_bytes call.
+ based on the patch by Masahiro Tomita. [ruby-dev:44270]
+
Fri Jul 29 20:48:39 2011 Tanaka Akira <akr@fsij.org>
* ext/socket/mkconstants.rb: fix typos.
diff --git a/lib/securerandom.rb b/lib/securerandom.rb
index d238a35406..04e8bc205e 100644
--- a/lib/securerandom.rb
+++ b/lib/securerandom.rb
@@ -57,7 +57,7 @@ module SecureRandom
n ||= 16
if defined? OpenSSL::Random
- @pid = $$ if !defined?(@pid)
+ @pid = 0 if !defined?(@pid)
pid = $$
if @pid != pid
now = Time.now