diff options
author | The Bundler Bot <bot@bundler.io> | 2016-12-15 00:05:29 +0000 |
---|---|---|
committer | The Bundler Bot <bot@bundler.io> | 2016-12-15 00:05:29 +0000 |
commit | 869bf08d37e9d796c895f478073a6127445af98f (patch) | |
tree | 5025bed9c6576f45e7c261f494a0338075a3eeea /lib | |
parent | bbdedac87996d869e2fa70f1f9f702e8f1195328 (diff) | |
parent | 8075f8cb2563df65e280bca482a21c3b20ce351b (diff) | |
download | bundler-869bf08d37e9d796c895f478073a6127445af98f.tar.gz |
Auto merge of #5222 - bundler:seg-fips, r=indirect
[CompactIndex] Disable when openssl is in fips mode
Should close #4989
Diffstat (limited to 'lib')
-rw-r--r-- | lib/bundler/fetcher/compact_index.rb | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/lib/bundler/fetcher/compact_index.rb b/lib/bundler/fetcher/compact_index.rb index 5d703a3a78..dcc9d57c13 100644 --- a/lib/bundler/fetcher/compact_index.rb +++ b/lib/bundler/fetcher/compact_index.rb @@ -3,10 +3,10 @@ require "bundler/fetcher/base" require "bundler/worker" module Bundler + autoload :CompactIndexClient, "bundler/compact_index_client" + class Fetcher class CompactIndex < Base - require "bundler/compact_index_client" - def self.compact_index_request(method_name) method = instance_method(method_name) undef_method(method_name) @@ -61,6 +61,7 @@ module Bundler compact_index_request :fetch_spec def available? + return nil unless md5_available? user_home = Bundler.user_home return nil unless user_home.directory? && user_home.writable? # Read info file checksums out of /versions, so we can know if gems are up to date @@ -119,6 +120,17 @@ module Bundler Net::HTTPNotModified.new(nil, nil, nil) end end + + def md5_available? + begin + require "openssl" + return false if defined?(OpenSSL::OPENSSL_FIPS) && OpenSSL::OPENSSL_FIPS + rescue LoadError + nil + end + + true + end end end end |