Skip to content

Commit

Permalink
(CONT-792) - Correct Lint/DeprecatedOpenSSLConstant
Browse files Browse the repository at this point in the history
  • Loading branch information
jordanbreen28 committed Apr 19, 2023
1 parent f83639c commit 723ae0d
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 9 deletions.
6 changes: 0 additions & 6 deletions .rubocop_todo.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,12 +13,6 @@ Lint/ConstantDefinitionInBlock:
Exclude:
- 'spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb'

# Offense count: 3
# This cop supports safe autocorrection (--autocorrect).
Lint/DeprecatedOpenSSLConstant:
Exclude:
- 'lib/puppet/functions/postgresql/postgresql_password.rb'

# Offense count: 1
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
Lint/DuplicateBranch:
Expand Down
6 changes: 3 additions & 3 deletions lib/puppet/functions/postgresql/postgresql_password.rb
Original file line number Diff line number Diff line change
Expand Up @@ -61,19 +61,19 @@ def digest_key(password, salt)
salt: salt,
iterations: 4096,
length: 32,
hash: OpenSSL::Digest::SHA256.new,
hash: OpenSSL::Digest.new('SHA256'),
)
end

def client_key(digest_key)
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest::SHA256.new)
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest.new('SHA256'))
hmac << 'Client Key'
hmac.digest
OpenSSL::Digest.new('SHA256').digest hmac.digest
end

def server_key(digest_key)
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest::SHA256.new)
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest.new('SHA256'))
hmac << 'Server Key'
hmac.digest
end
Expand Down

0 comments on commit 723ae0d

Please sign in to comment.