Skip to content

Commit

Permalink
Showing 1 changed file with 2 additions and 1 deletion.
Original file line number Diff line number Diff line change
@@ -56,7 +56,8 @@ module SecureRandom
def self.random_bytes(n=nil)
n ||= 16

if defined? OpenSSL::Random
# TODO (pitr 04-Oct-2015): pending PR https://github.com/rubysl/rubysl-securerandom/pull/1
if defined?(OpenSSL::Random) && OpenSSL::Random != Random
@pid = 0 if !defined?(@pid)
pid = $$
if @pid != pid

2 comments on commit 0ab1c79

@nirvdrum
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you clarify what the point of this is? Shouldn't ::Random be used if you really want the top-level Random?

Sorry, something went wrong.

@pitr-ch
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sorry, something went wrong.

Please sign in to comment.