[前][次][番号順一覧][スレッド一覧]

ruby-changes:20693

From: akr <ko1@a...>
Date: Sat, 30 Jul 2011 00:01:33 +0900 (JST)
Subject: [ruby-changes:20693] akr:r32741 (trunk, ruby_1_8, ruby_1_9_3): * lib/securerandom.rb: call OpenSSL::Random.seed at the

akr	2011-07-30 00:01:20 +0900 (Sat, 30 Jul 2011)

  New Revision: 32741

  http://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=rev&revision=32741

  Log:
    * lib/securerandom.rb: call OpenSSL::Random.seed at the 
      SecureRandom.random_bytes call.
      based on the patch by Masahiro Tomita.  [ruby-dev:44270]

  Modified files:
    branches/ruby_1_8/ChangeLog
    branches/ruby_1_8/lib/securerandom.rb
    branches/ruby_1_9_3/ChangeLog
    branches/ruby_1_9_3/lib/securerandom.rb
    trunk/ChangeLog
    trunk/lib/securerandom.rb

Index: ChangeLog
===================================================================
--- ChangeLog	(revision 32740)
+++ ChangeLog	(revision 32741)
@@ -1,3 +1,9 @@
+Fri Jul 29 23:56:32 2011  Tanaka Akira  <akr@f...>
+
+	* 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  <nobu@r...>
 
 	* array.c (rb_ary_set_len): new function to set array length.
Index: lib/securerandom.rb
===================================================================
--- lib/securerandom.rb	(revision 32740)
+++ lib/securerandom.rb	(revision 32741)
@@ -57,7 +57,7 @@
     n ||= 16
 
     if defined? OpenSSL::Random
-      @pid = $$ if !defined?(@pid)
+      @pid = 0 if !defined?(@pid)
       pid = $$
       if @pid != pid
         now = Time.now
Index: ruby_1_8/ChangeLog
===================================================================
--- ruby_1_8/ChangeLog	(revision 32740)
+++ ruby_1_8/ChangeLog	(revision 32741)
@@ -1,3 +1,10 @@
+Fri Jul 29 23:56:32 2011  Tanaka Akira  <akr@f...>
+
+	* lib/securerandom.rb: call OpenSSL::Random.seed at the
+	  SecureRandom.random_bytes call.
+	  insert separators for array join.
+	  patch by Masahiro Tomita.  [ruby-dev:44270]
+
 Sun Jul 17 18:24:22 2011  Tadayoshi Funaba  <tadf@d...>
 
 	* lib/date.rb (complete_frags): Monday must be suitable for %W's
Index: ruby_1_8/lib/securerandom.rb
===================================================================
--- ruby_1_8/lib/securerandom.rb	(revision 32740)
+++ ruby_1_8/lib/securerandom.rb	(revision 32741)
@@ -50,12 +50,12 @@
   def self.random_bytes(n=nil)
     n ||= 16
     if defined? OpenSSL::Random
-      @pid = $$ if !defined?(@pid)
+      @pid = 0 if !defined?(@pid)
       pid = $$
       if @pid != pid
         now = Time.now
         ary = [now.to_i, now.usec, @pid, pid]
-        OpenSSL::Random.seed(ary.to_s)
+        OpenSSL::Random.seed(ary.join('.'))
         @pid = pid
       end
       return OpenSSL::Random.random_bytes(n)
Index: ruby_1_9_3/ChangeLog
===================================================================
--- ruby_1_9_3/ChangeLog	(revision 32740)
+++ ruby_1_9_3/ChangeLog	(revision 32741)
@@ -1,3 +1,9 @@
+Fri Jul 29 23:56:32 2011  Tanaka Akira  <akr@f...>
+
+	* 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@f...>
 
 	* ext/socket/mkconstants.rb: fix typos.
Index: ruby_1_9_3/lib/securerandom.rb
===================================================================
--- ruby_1_9_3/lib/securerandom.rb	(revision 32740)
+++ ruby_1_9_3/lib/securerandom.rb	(revision 32741)
@@ -57,7 +57,7 @@
     n ||= 16
 
     if defined? OpenSSL::Random
-      @pid = $$ if !defined?(@pid)
+      @pid = 0 if !defined?(@pid)
       pid = $$
       if @pid != pid
         now = Time.now

--
ML: ruby-changes@q...
Info: http://www.atdot.net/~ko1/quickml/

[前][次][番号順一覧][スレッド一覧]