Verified Commit c79dbf95 authored by Luke Hollinda's avatar Luke Hollinda Committed by GitLab
Browse files

Merge branch 'mzajac/use-top-level-openssl-constant' into 'master'

Use top-level OpenSSL constant

See merge request !301

Merged-by: default avatarLuke Hollinda <lhollinda@gitlab.com>
Approved-by: default avatarLuke Hollinda <lhollinda@gitlab.com>
Reviewed-by: default avatarMichał Zając <mzajac@gitlab.com>
Reviewed-by: default avatarGitLab Duo <gitlab-duo@gitlab.com>
Co-authored-by: default avatarMichał Zając <mzajac@gitlab.com>
parents b283c27c 43f29c4b
Loading
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