Skip to content

Commit b021488

Browse files
tas50robbkidd
authored andcommitted
resolve openssl deprecation, Rubocop: Lint/DeprecatedOpenSSLConstant
> Lint/DeprecatedOpenSSLConstant: > Use OpenSSL::Digest.hexdigest('MD5', key_in_der_format) instead of > OpenSSL::Digest::MD5.hexdigest(key_in_der_format). Rubocop has a new cop[1] that detects an upcoming deprecation to the OpenSSL gem[2] that's built into Ruby. [1] rubocop/rubocop#7950 [2] ruby/openssl#366 The previous constant will cause failures in Ruby 3. Signed-off-by: Tim Smith <[email protected]> Signed-off-by: Robb Kidd <[email protected]>
1 parent c21b775 commit b021488

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/supermarket/app/models/user.rb

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -226,7 +226,7 @@ def public_key_signature
226226
# with private key: openssl rsa -in private_key.pem -pubout -outform DER | openssl md5 -c
227227
# with public key: openssl rsa -in public_key.pub -pubin -outform DER | openssl md5 -c
228228
key_in_der_format = OpenSSL::PKey::RSA.new(public_key).to_der
229-
OpenSSL::Digest::MD5.hexdigest(key_in_der_format).scan(/../).join(':')
229+
OpenSSL::Digest.hexdigest('MD5', key_in_der_format).scan(/../).join(':')
230230
end
231231

232232
private

0 commit comments

Comments
 (0)