From c620acaced507cd0d61e7e9d7acbeca9cb99f158 Mon Sep 17 00:00:00 2001 From: nagachika Date: Mon, 13 Apr 2015 04:10:25 +0000 Subject: * lib/securerandom.rb: skip Win32 libraries in SecureRandom if OpenSSL::Random is available. https://github.com/ruby/ruby/pull/848 [Bug #10948] [Bug #10995] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_2_2@50281 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- lib/securerandom.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'lib/securerandom.rb') diff --git a/lib/securerandom.rb b/lib/securerandom.rb index 3e932f6b0e..c26bf50b02 100644 --- a/lib/securerandom.rb +++ b/lib/securerandom.rb @@ -40,7 +40,7 @@ end # p SecureRandom.random_bytes(10) #=> "\016\t{\370g\310pbr\301" # p SecureRandom.random_bytes(10) #=> "\323U\030TO\234\357\020\a\337" module SecureRandom - if /mswin|mingw/ =~ RUBY_PLATFORM + if !defined?(OpenSSL::Random) && /mswin|mingw/ =~ RUBY_PLATFORM require "fiddle/import" module AdvApi32 # :nodoc: -- cgit v1.2.3