Skip to content

Commit

Permalink
Use openssl? instead of OpenSSL::OPENSSL_VERSION_NUMBER.
Browse files Browse the repository at this point in the history
  • Loading branch information
junaruga committed Aug 15, 2023
1 parent db633c5 commit a237e44
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion test/openssl/test_cipher.rb
Original file line number Diff line number Diff line change
Expand Up @@ -205,7 +205,7 @@ def test_aes_ccm
assert_raise(OpenSSL::Cipher::CipherError) { cipher.update(ct2) }
end if has_cipher?("aes-128-ccm") &&
OpenSSL::Cipher.new("aes-128-ccm").authenticated? &&
OpenSSL::OPENSSL_VERSION_NUMBER >= 0x1010103f # version >= 1.1.1c
openssl?(1, 1, 1, 0x03) # version >= 1.1.1c

def test_aes_gcm
# GCM spec Appendix B Test Case 4
Expand Down
2 changes: 1 addition & 1 deletion test/openssl/test_pkey.rb
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,7 @@ def test_x25519
end

def raw_initialize
pend "Ed25519 is not implemented" unless OpenSSL::OPENSSL_VERSION_NUMBER >= 0x10101000 && # >= v1.1.1
pend "Ed25519 is not implemented" unless openssl?(1, 1, 1) # >= v1.1.1

assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_private_key("foo123", "xxx") }
assert_raise(OpenSSL::PKey::PKeyError) { OpenSSL::PKey.new_raw_private_key("ED25519", "xxx") }
Expand Down

0 comments on commit a237e44

Please sign in to comment.