Sha256: ae55d530c69513e3dbcece4e08abc193efaa1c6967422a4334811053175a875c

Contents?: true

Size: 705 Bytes

Versions: 2

Compression:

Stored size: 705 Bytes

Contents

# frozen_string_literal: true

require_relative '../../../gitlab/styles/common/banned_constants'

module Rubocop
  module Cop
    module Fips
      class MD5 < RuboCop::Cop::Base
        include Gitlab::Styles::Common::BannedConstants

        MESSAGE_TEMPLATE = 'MD5 is not FIPS-compliant. Use %{replacement} instead.'

        REPLACEMENTS = {
          'OpenSSL::Digest::MD5' => 'OpenSSL::Digest::SHA256',
          'Digest::MD5' => 'OpenSSL::Digest::SHA256'
        }.freeze

        def initialize(config = nil, options = nil)
          @message_template = MESSAGE_TEMPLATE
          @replacements = REPLACEMENTS
          @autocorrect = false
          super
        end
      end
    end
  end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
gitlab-styles-13.0.1 lib/rubocop/cop/fips/md5.rb
gitlab-styles-13.0.0 lib/rubocop/cop/fips/md5.rb