From 31eb19bbb66480f65defe1d00df42abe52f109dd Mon Sep 17 00:00:00 2001 From: akr Date: Fri, 29 Jul 2011 15:01:20 +0000 Subject: [PATCH] * lib/securerandom.rb: call OpenSSL::Random.seed at the SecureRandom.random_bytes call. based on the patch by Masahiro Tomita. [ruby-dev:44270] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@32741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- ChangeLog | 6 ++++++ lib/securerandom.rb | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/ChangeLog b/ChangeLog index c5f6dac7b5..795e5ddad4 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,9 @@ +Fri Jul 29 23:56:32 2011 Tanaka Akira + + * 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 23:53:48 2011 Nobuyoshi Nakada * array.c (rb_ary_set_len): new function to set array length. 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