Verified Commit 43f29c4b authored by Michał Zając's avatar Michał Zając
Browse files

Use top-level OpenSSL constant

parent b283c27c
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -25,7 +25,7 @@ module Labkit
        return true if %w[1 true yes].include?(ENV["FIPS_MODE"])

        # Otherwise, attempt to auto-detect FIPS mode from OpenSSL
        return true if OpenSSL.fips_mode
        return true if ::OpenSSL.fips_mode

        false
      end
@@ -44,7 +44,7 @@ module Labkit

      def use_openssl_digest(ruby_algorithm, openssl_algorithm)
        ::Digest.send(:remove_const, ruby_algorithm) # rubocop:disable GitlabSecurity/PublicSend
        ::Digest.const_set(ruby_algorithm, OpenSSL::Digest.const_get(openssl_algorithm, false))
        ::Digest.const_set(ruby_algorithm, ::OpenSSL::Digest.const_get(openssl_algorithm, false))
      end
    end
  end