Bug #4579 » securerandom-openssl-pid-recycle.patch
| 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
|
||