summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ChangeLog5
-rw-r--r--lib/securerandom.rb4
2 files changed, 9 insertions, 0 deletions
@@ -1,3 +1,8 @@
Wed Oct 21 12:10:04 2015 KOSAKI Motohiro <[email protected]>
* ext/openssl/ossl_rand.c (ossl_rand_bytes): RAND_bytes could
@@ -56,6 +56,10 @@ module SecureRandom
now = Process.clock_gettime(Process::CLOCK_REALTIME, :nanosecond)
ary = [now, @pid, pid]
OpenSSL::Random.random_add(ary.join("").to_s, 0.0)
@pid = pid
end
return OpenSSL::Random.random_bytes(n)