diff options
author | Tomas Mraz <tomas@openssl.org> | 2024-04-11 10:29:23 +0200 |
---|---|---|
committer | Tomas Mraz <tomas@openssl.org> | 2024-05-15 12:10:32 +0200 |
commit | b911fef216d1386210ec24e201d54d709528abb4 (patch) | |
tree | 286d441c79a388be8d94950b8111bf2793eaebf0 /test/recipes | |
parent | 170620675dfd74f34bdcf8aba71dffeb07f3d533 (diff) | |
download | openssl-b911fef216d1386210ec24e201d54d709528abb4.zip openssl-b911fef216d1386210ec24e201d54d709528abb4.tar.gz openssl-b911fef216d1386210ec24e201d54d709528abb4.tar.bz2 |
Intentionally break EVP_DigestFinal for SHAKE128 and SHAKE256
It will work only if OSSL_DIGEST_PARAM_XOFLEN is set.
Reviewed-by: Paul Dale <ppzgs1@gmail.com>
Reviewed-by: Shane Lontis <shane.lontis@oracle.com>
(Merged from https://github.com/openssl/openssl/pull/24105)
Diffstat (limited to 'test/recipes')
-rw-r--r-- | test/recipes/20-test_dgst.t | 8 |
1 files changed, 3 insertions, 5 deletions
diff --git a/test/recipes/20-test_dgst.t b/test/recipes/20-test_dgst.t index aed7bf3..5f07789 100644 --- a/test/recipes/20-test_dgst.t +++ b/test/recipes/20-test_dgst.t @@ -223,13 +223,11 @@ subtest "Custom length XOF digest generation with `dgst` CLI" => sub { }; subtest "SHAKE digest generation with no xoflen set `dgst` CLI" => sub { - plan tests => 1; + plan tests => 2; my $testdata = srctop_file('test', 'data.bin'); - my @xofdata = run(app(['openssl', 'dgst', '-shake128', $testdata], stderr => "outerr.txt"), capture => 1); - chomp(@xofdata); - my $expected = qr/SHAKE-128\(\Q$testdata\E\)= bb565dac72640109e1c926ef441d3fa6/; - ok($xofdata[0] =~ $expected, "Check short digest is output"); + ok(!run(app(['openssl', 'dgst', '-shake128', $testdata])), "SHAKE128 must fail without xoflen"); + ok(!run(app(['openssl', 'dgst', '-shake256', $testdata])), "SHAKE256 must fail without xoflen"); }; SKIP: { |