diff options
author | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-02 11:02:10 +0000 |
---|---|---|
committer | naruse <naruse@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-02-02 11:02:10 +0000 |
commit | fb57dd5a8cbeae05834a65cac2d6936109c913b8 (patch) | |
tree | b230ac413f627fa8b00f3e8ec1d2b8759cf98619 | |
parent | 4e9047e800af734f478847a5313f708a4843512f (diff) | |
download | ruby-fb57dd5a8cbeae05834a65cac2d6936109c913b8.tar.gz |
Skip SHA from test_digest_constants for LibreSSL 2.3
The first one of ruby/openssl#40
https://github.com/ruby/openssl/issues/40#issuecomment-159839338
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53718 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r-- | test/openssl/test_digest.rb | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/test/openssl/test_digest.rb b/test/openssl/test_digest.rb index e206ca0283..8b724a03a9 100644 --- a/test/openssl/test_digest.rb +++ b/test/openssl/test_digest.rb @@ -58,7 +58,10 @@ class OpenSSL::TestDigest < Test::Unit::TestCase end def test_digest_constants - algs = %w(DSS1 MD4 MD5 RIPEMD160 SHA SHA1) + algs = %w(DSS1 MD4 MD5 RIPEMD160 SHA1) + if !libressl? || !version_since([2,3]) + algs += %w(SHA) + end if OpenSSL::OPENSSL_VERSION_NUMBER > 0x00908000 algs += %w(SHA224 SHA256 SHA384 SHA512) end @@ -122,6 +125,14 @@ class OpenSSL::TestDigest < Test::Unit::TestCase d = OpenSSL::Digest.new(oid.oid) assert_not_nil(d) end + + def libressl? + OpenSSL::OPENSSL_VERSION.include?('LibreSSL') + end + + def version_since(verary) + (OpenSSL::OPENSSL_LIBRARY_VERSION.scan(/\d+/).map(&:to_i) <=> verary) != -1 + end end end |