securerandom.patch

Martin Bosslet, 08/26/2012 01:58 AM

Download (454 Bytes)

View differences:

lib/securerandom.rb (working copy)
62 62
      if @pid != pid
63 63
        now = Time.now
64 64
        ary = [now.to_i, now.nsec, @pid, pid]
65
        OpenSSL::Random.seed(ary.to_s)
65
        OpenSSL::Random.random_add(ary.to_s, 0.0)
66 66
        @pid = pid
67 67
      end
68 68
      return OpenSSL::Random.random_bytes(n)