Project

General

Profile

Bug #4579 » securerandom-openssl-pid-recycle.patch

akr (Akira Tanaka), 06/13/2011 01:11 AM

View differences:

lib/securerandom.rb (working copy)
n ||= 16
if defined? OpenSSL::Random
@pid = $$ if !defined?(@pid)
pid = $$
if @pid != pid
now = Time.now
OpenSSL::Random.seed(now.to_i.to_s + now.nsec.to_s)
@pid = pid
end
return OpenSSL::Random.random_bytes(n)
end
(5-5/6)