Class: Rubocop::Cop::Fips::OpenSSL

Inherits:
RuboCop::Cop::Base
  • Object
show all
Extended by:
RuboCop::Cop::AutoCorrector
Includes:
Gitlab::Styles::Common::BannedConstants
Defined in:
lib/rubocop/cop/fips/open_ssl.rb

Constant Summary collapse

MESSAGE_TEMPLATE =
'Usage of this class is not FIPS-compliant. Use %{replacement} instead.'
REPLACEMENTS =
{
  'Digest::SHA1' => 'OpenSSL::Digest::SHA1',
  'Digest::SHA2' => 'OpenSSL::Digest::SHA256',
  'Digest::SHA256' => 'OpenSSL::Digest::SHA256',
  'Digest::SHA384' => 'OpenSSL::Digest::SHA384',
  'Digest::SHA512' => 'OpenSSL::Digest::SHA512'
}.freeze

Instance Attribute Summary

Attributes included from Gitlab::Styles::Common::BannedConstants

#autocorrect, #message_template, #replacements

Instance Method Summary collapse

Methods included from Gitlab::Styles::Common::BannedConstants

#on_const

Constructor Details

#initialize(config = nil, options = nil) ⇒ OpenSSL

Returns a new instance of OpenSSL.



22
23
24
25
26
27
# File 'lib/rubocop/cop/fips/open_ssl.rb', line 22

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