Skip to content
This repository has been archived by the owner on Apr 14, 2021. It is now read-only.

Commit

Permalink
[CompactIndex] Only check for fips constant when it is defined
Browse files Browse the repository at this point in the history
  • Loading branch information
segiddins committed Dec 2, 2016
1 parent 032203d commit 8075f8c
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion lib/bundler/fetcher/compact_index.rb
Original file line number Diff line number Diff line change
Expand Up @@ -124,7 +124,7 @@ def call(path, headers)
def md5_available?
begin
require "openssl"
return false if OpenSSL::OPENSSL_FIPS
return false if defined?(OpenSSL::OPENSSL_FIPS) && OpenSSL::OPENSSL_FIPS
rescue LoadError
nil
end
Expand Down
2 changes: 1 addition & 1 deletion spec/bundler/fetcher/compact_index_spec.rb
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@
end

describe "#available?" do
context "when OpenSSL is in FIPS mode" do
context "when OpenSSL is in FIPS mode", :ruby => ">= 2.0.0" do
before { stub_const("OpenSSL::OPENSSL_FIPS", true) }

it "returns false" do
Expand Down

0 comments on commit 8075f8c

Please sign in to comment.