Skip to content

Files

Latest commit

 

History

History
44 lines (28 loc) · 816 Bytes

Lint-DeprecatedOpenSSLConstant.md

File metadata and controls

44 lines (28 loc) · 816 Bytes

Pattern: Use of deprecated algorithmic constant for OpenSSL

Issue: -

Description

Algorithmic constants for OpenSSL::Cipher and OpenSSL::Digest deprecated since OpenSSL version 2.2.0. Prefer passing a string instead.

Examples

# Example for OpenSSL::Cipher instantiation.

# bad
OpenSSL::Cipher::AES.new(128, :GCM)

# good
OpenSSL::Cipher.new('AES-128-GCM')
# Example for OpenSSL::Digest instantiation.

# bad
OpenSSL::Digest::SHA256.new

# good
OpenSSL::Digest.new('SHA256')
# Example for ::Digest inherited class methods.

# bad
OpenSSL::Digest::SHA256.digest('foo')

# good
OpenSSL::Digest.digest('SHA256', 'foo')

Further Reading