Skip to content
This repository

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse code

merge revision(s) 32741:

?\012
	* 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@ruby-lang.org>

git-svn-id: http://svn.ruby-lang.org/repos/ruby/branches/ruby_1_8_7@34003 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
  • Loading branch information...
commit b696930909cdac368d09cec8ae4bc328a8689a7b 1 parent 3dbcd24
Urabe, Shyouhei shyouhei authored

Showing 2 changed files with 9 additions and 2 deletions. Show diff stats Hide diff stats

  1. +7 0 ChangeLog
  2. +2 2 lib/securerandom.rb
7 ChangeLog
... ... @@ -1,3 +1,10 @@
  1 +Sat Dec 10 20:44:23 2011 Tanaka Akira <akr@fsij.org>
  2 +
  3 + * lib/securerandom.rb: call OpenSSL::Random.seed at the
  4 + SecureRandom.random_bytes call.
  5 + insert separators for array join.
  6 + patch by Masahiro Tomita. [ruby-dev:44270]
  7 +
1 8 Mon Oct 17 04:20:22 2011 Nobuyoshi Nakada <nobu@ruby-lang.org>
2 9
3 10 * mkconfig.rb: fix for continued lines. based on a patch from
4 lib/securerandom.rb
@@ -50,12 +50,12 @@ module SecureRandom
50 50 def self.random_bytes(n=nil)
51 51 n ||= 16
52 52 if defined? OpenSSL::Random
53   - @pid = $$ if !defined?(@pid)
  53 + @pid = 0 if !defined?(@pid)
54 54 pid = $$
55 55 if @pid != pid
56 56 now = Time.now
57 57 ary = [now.to_i, now.usec, @pid, pid]
58   - OpenSSL::Random.seed(ary.to_s)
  58 + OpenSSL::Random.seed(ary.join('.'))
59 59 @pid = pid
60 60 end
61 61 return OpenSSL::Random.random_bytes(n)

0 comments on commit b696930

Please sign in to comment.
Something went wrong with that request. Please try again.