From: Pauli Date: Mon, 29 Jul 2024 02:24:18 +0000 (+1000) Subject: test: add unit tests for disallowed XOF digests X-Git-Tag: openssl-3.4.0-alpha1~156 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=db9eb0f96c24e2c6e739ab5a0f02bb9cf3dc81f3;p=thirdparty%2Fopenssl.git test: add unit tests for disallowed XOF digests Reviewed-by: Dmitry Belyavskiy Reviewed-by: Shane Lontis (Merged from https://github.com/openssl/openssl/pull/25020) --- diff --git a/test/recipes/30-test_evp_data/evppkey_dsa.txt b/test/recipes/30-test_evp_data/evppkey_dsa.txt index 51c4405b158..027566b42da 100644 --- a/test/recipes/30-test_evp_data/evppkey_dsa.txt +++ b/test/recipes/30-test_evp_data/evppkey_dsa.txt @@ -477,3 +477,11 @@ KeyParam = DSA-2048-PARAMS KeyName = tmp2dsa Unapproved = 1 Ctrl = sign-check:0 + +Title = XOF disallowed + +DigestVerify = SHAKE256 +Key = DSA-1024 +Input = "Hello " +Result = DIGESTVERIFYINIT_ERROR + diff --git a/test/recipes/30-test_evp_data/evppkey_ecdsa.txt b/test/recipes/30-test_evp_data/evppkey_ecdsa.txt index cca8c069454..71c65acfaa4 100644 --- a/test/recipes/30-test_evp_data/evppkey_ecdsa.txt +++ b/test/recipes/30-test_evp_data/evppkey_ecdsa.txt @@ -214,7 +214,7 @@ Input = "Hello World" Result = DIGESTSIGNINIT_ERROR # Test that SHA1 is not allowed in fips mode for signing -Availablein = fips +FIPSversion = >=3.4.0 Sign = P-256 Securitycheck = 1 Ctrl = digest:SHA1 @@ -260,3 +260,10 @@ CtrlInit = digest-check:0 Ctrl = digest:SHA1 Input = "0123456789ABCDEF1234" Result = KEYOP_MISMATCH + +Title = XOF disallowed + +DigestVerify = SHAKE256 +Key = B-163 +Input = "Hello World" +Result = DIGESTVERIFYINIT_ERROR diff --git a/test/recipes/30-test_evp_data/evppkey_rsa.txt b/test/recipes/30-test_evp_data/evppkey_rsa.txt index b36a19f4fd0..4e6d6af220f 100644 --- a/test/recipes/30-test_evp_data/evppkey_rsa.txt +++ b/test/recipes/30-test_evp_data/evppkey_rsa.txt @@ -656,3 +656,11 @@ Securitycheck = 1 Unapproved = 1 CtrlInit = key-check:0 Op = RSASVE + +Title = XOF disallowed + +DigestSign = SHAKE128 +Key = RSA-2048 +Input = "Hello World" +Result = DIGESTSIGNINIT_ERROR + diff --git a/test/recipes/30-test_evp_data/evppkey_sm2.txt b/test/recipes/30-test_evp_data/evppkey_sm2.txt index 410be7abeef..5e4b813f378 100644 --- a/test/recipes/30-test_evp_data/evppkey_sm2.txt +++ b/test/recipes/30-test_evp_data/evppkey_sm2.txt @@ -83,3 +83,11 @@ KeyName = SM2_genkey1 KeyGen = SM2 Ctrl = group:sm2 KeyName = SM2_genkey2 + +Title = XOF disallowed + +Availablein = default +Decrypt = SM2_key1 +Ctrl = digest:SHAKE128 +Input = 3081DD022100CD49634BBCB21CAFFFA6D33669A5A867231CB2A942A14352EF4CAF6DC3344D54022100C35B41D4DEBB3A2735EFEE821B9EBA566BD86900176A0C06672E30EE5CC04E930420C4190A3D80D86C4BD20E99F7E4B59BF6427C6808793533EEA9591D1188EC56B50473747295470E81D951BED279AC1B86A1AFE388CD2833FA9632799EC199C7D364E5663D5A94888BB2358CFCBF6283184DE0CBC41CCEA91D24746E99D231A1DA77AFD83CDF908190ED628B7369724494568A27C782A1D1D7294BCAD80C34569ED22859896301128A8118F48924D8CCD43E998D9533 +Result = KEYOP_ERROR