diff options
author | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 06:41:31 +0000 |
---|---|---|
committer | usa <usa@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2016-06-10 06:41:31 +0000 |
commit | ddc47a94756381c9bc56a918728631209099669d (patch) | |
tree | bab3ffae433c2bdcd3244acfda96a9d076ca48a3 /test | |
parent | 03b383a5754042573fbc2fcfa9f809cdeee438ae (diff) |
merge revision(s) 53718: [Backport #12320]
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/branches/ruby_2_2@55349 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'test')
-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 a23b2ef0a2..6fb3306c89 100644 --- a/test/openssl/test_digest.rb +++ b/test/openssl/test_digest.rb @@ -57,7 +57,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 @@ -121,6 +124,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 |