Skip to content

Commit 723ae0d

Browse files
author
jordanbreen28
committed
(CONT-792) - Correct Lint/DeprecatedOpenSSLConstant
1 parent f83639c commit 723ae0d

File tree

2 files changed

+3
-9
lines changed

2 files changed

+3
-9
lines changed

.rubocop_todo.yml

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -13,12 +13,6 @@ Lint/ConstantDefinitionInBlock:
1313
Exclude:
1414
- 'spec/unit/puppet/provider/postgresql_replication_slot/ruby_spec.rb'
1515

16-
# Offense count: 3
17-
# This cop supports safe autocorrection (--autocorrect).
18-
Lint/DeprecatedOpenSSLConstant:
19-
Exclude:
20-
- 'lib/puppet/functions/postgresql/postgresql_password.rb'
21-
2216
# Offense count: 1
2317
# Configuration parameters: IgnoreLiteralBranches, IgnoreConstantBranches.
2418
Lint/DuplicateBranch:

lib/puppet/functions/postgresql/postgresql_password.rb

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -61,19 +61,19 @@ def digest_key(password, salt)
6161
salt: salt,
6262
iterations: 4096,
6363
length: 32,
64-
hash: OpenSSL::Digest::SHA256.new,
64+
hash: OpenSSL::Digest.new('SHA256'),
6565
)
6666
end
6767

6868
def client_key(digest_key)
69-
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest::SHA256.new)
69+
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest.new('SHA256'))
7070
hmac << 'Client Key'
7171
hmac.digest
7272
OpenSSL::Digest.new('SHA256').digest hmac.digest
7373
end
7474

7575
def server_key(digest_key)
76-
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest::SHA256.new)
76+
hmac = OpenSSL::HMAC.new(digest_key, OpenSSL::Digest.new('SHA256'))
7777
hmac << 'Server Key'
7878
hmac.digest
7979
end

0 commit comments

Comments
 (0)