[ruby/openssl] digest: always run SHA-3 and truncated SHA-2 tests

The "pend" are no longer necessary, as they work with all OpenSSL
variants we currently support. They were added in OpenSSL 1.1.1 and
LibreSSL 3.8.0. They are also supported by the current AWS-LC release.

This makes the SHA-3 tests run with AWS-LC correctly. AWS-LC does not
report SHA-3 in OpenSSL::Digest.digests.

https://github.com/ruby/openssl/commit/e1a6e9c081
This commit is contained in:
Kazuki Yamaguchi 2025-02-26 23:00:56 +09:00 committed by git
parent 9994a95790
commit f5a74bd645

View File

@ -88,7 +88,6 @@ class OpenSSL::TestDigest < OpenSSL::TestCase
end
def test_sha512_truncate
pend "SHA512_224 is not implemented" unless digest_available?('sha512-224')
sha512_224_a = "d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327"
sha512_256_a = "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8"
@ -100,7 +99,6 @@ class OpenSSL::TestDigest < OpenSSL::TestCase
end
def test_sha3
pend "SHA3 is not implemented" unless digest_available?('sha3-224')
s224 = '6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7'
s256 = 'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a'
s384 = '0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004'
@ -145,11 +143,6 @@ class OpenSSL::TestDigest < OpenSSL::TestCase
d = OpenSSL::Digest.new(oid.oid)
assert_not_nil(d)
end
def digest_available?(name)
@digests ||= OpenSSL::Digest.digests
@digests.include?(name)
end
end
end