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

ruby-changes:21953

From: shyouhei <ko1@a...>
Date: Sat, 10 Dec 2011 21:18:34 +0900 (JST)
Subject: [ruby-changes:21953] shyouhei:r34003 (ruby_1_8_7): merge revision(s) 32741:

shyouhei	2011-12-10 21:17:33 +0900 (Sat, 10 Dec 2011)

  New Revision: 34003

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

  Log:
    merge revision(s) 32741:
    
    * 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/branches/ruby_1_8@32741 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
    Signed-off-by: URABE, Shyouhei <shyouhei@r...>

  Modified files:
    branches/ruby_1_8_7/ChangeLog
    branches/ruby_1_8_7/lib/securerandom.rb

Index: ruby_1_8_7/ChangeLog
===================================================================
--- ruby_1_8_7/ChangeLog	(revision 34002)
+++ ruby_1_8_7/ChangeLog	(revision 34003)
@@ -1,3 +1,10 @@
+Sat Dec 10 20:44:23 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]
+
 Mon Oct 17 04:20:22 2011  Nobuyoshi Nakada  <nobu@r...>
 
 	* mkconfig.rb: fix for continued lines.  based on a patch from
Index: ruby_1_8_7/lib/securerandom.rb
===================================================================
--- ruby_1_8_7/lib/securerandom.rb	(revision 34002)
+++ ruby_1_8_7/lib/securerandom.rb	(revision 34003)
@@ -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)

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

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