aboutsummaryrefslogtreecommitdiff
path: root/test
diff options
context:
space:
mode:
authorRichard Levitte <levitte@openssl.org>2020-09-03 07:22:00 +0200
committerRichard Levitte <levitte@openssl.org>2020-09-08 12:07:36 +0200
commitb968945204130620b1328f585610cbe1d6b5a69e (patch)
tree7d023da0175f9f3de0f9a40654daa7a316b4045e /test
parent86df26b3943509219057ae87f8764b3c15e0d8b8 (diff)
downloadopenssl-b968945204130620b1328f585610cbe1d6b5a69e.zip
openssl-b968945204130620b1328f585610cbe1d6b5a69e.tar.gz
openssl-b968945204130620b1328f585610cbe1d6b5a69e.tar.bz2
EVP: Expand the use of EVP_PKEY_CTX_md()
Setting a hash function was reserved for signature operations. However, it turns out that SM2 uses a hash function for encryption and decryption as well. Therefore, EVP_PKEY_CTX_md() must be called with an expanded operation type combination that includes EVP_PKEY_OP_TYPE_CRYPT when used in a generic way. For SM2, test/recipes/30-test_evp_data/evppkey_sm2.txt is expanded to test decryption both with an implicit and an explicit digest. Reviewed-by: Shane Lontis <shane.lontis@oracle.com> (Merged from https://github.com/openssl/openssl/pull/12789)
Diffstat (limited to 'test')
-rw-r--r--test/recipes/30-test_evp_data/evppkey_sm2.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/test/recipes/30-test_evp_data/evppkey_sm2.txt b/test/recipes/30-test_evp_data/evppkey_sm2.txt
index b5b36de..85a60b0 100644
--- a/test/recipes/30-test_evp_data/evppkey_sm2.txt
+++ b/test/recipes/30-test_evp_data/evppkey_sm2.txt
@@ -42,6 +42,12 @@ Output = 3046022100AE018933B9BA041784380069F2DDF609694DCD299FDBF23D09F4B711FBC10
Availablein = default
Decrypt = SM2_key1
+Input = 30818A0220466BE2EF5C11782EC77864A0055417F407A5AFC11D653C6BCE69E417BB1D05B6022062B572E21FF0DDF5C726BD3F9FF2EAE56E6294713A607E9B9525628965F62CC804203C1B5713B5DB2728EB7BF775E44F4689FC32668BDC564F52EA45B09E8DF2A5F40422084A9D0CC2997092B7D3C404FCE95956EB604D732B2307A8E5B8900ED6608CA5B197
+Output = "The floofy bunnies hop at midnight"
+
+# This is the same as above, but with explicit digest control
+Availablein = default
+Decrypt = SM2_key1
Ctrl = digest:SM3
Input = 30818A0220466BE2EF5C11782EC77864A0055417F407A5AFC11D653C6BCE69E417BB1D05B6022062B572E21FF0DDF5C726BD3F9FF2EAE56E6294713A607E9B9525628965F62CC804203C1B5713B5DB2728EB7BF775E44F4689FC32668BDC564F52EA45B09E8DF2A5F40422084A9D0CC2997092B7D3C404FCE95956EB604D732B2307A8E5B8900ED6608CA5B197
Output = "The floofy bunnies hop at midnight"