Skip to content

Commit

Permalink
digest: always run SHA-3 and truncated SHA-2 tests
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
rhenium committed Feb 26, 2025
1 parent d725783 commit e1a6e9c
Showing 1 changed file with 0 additions and 7 deletions.
7 changes: 0 additions & 7 deletions test/openssl/test_digest.rb
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,6 @@ def test_sha2
end

def test_sha512_truncate
pend "SHA512_224 is not implemented" unless digest_available?('sha512-224')
sha512_224_a = "d5cdb9ccc769a5121d4175f2bfdd13d6310e0d3d361ea75d82108327"
sha512_256_a = "455e518824bc0601f9fb858ff5c37d417d67c2f8e0df2babe4808858aea830f8"

Expand All @@ -100,7 +99,6 @@ def test_sha512_truncate
end

def test_sha3
pend "SHA3 is not implemented" unless digest_available?('sha3-224')
s224 = '6b4e03423667dbb73b6e15454f0eb1abd4597f9a1b078e3f5b5a6bc7'
s256 = 'a7ffc6f8bf1ed76651c14756a061d662f580ff4de43b49fa82d80a4b80f8434a'
s384 = '0c63a75b845e4f7d01107d852e4c2485c51a50aaaa94fc61995e71bbee983a2ac3713831264adb47fb6bd1e058d5f004'
Expand Down Expand Up @@ -145,11 +143,6 @@ def check_digest(oid)
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

0 comments on commit e1a6e9c

Please sign in to comment.