]> git.ipfire.org Git - thirdparty/openssl.git/commit - crypto/evp/pmeth_lib.c
EVP: Expand the use of EVP_PKEY_CTX_md()
authorRichard Levitte <levitte@openssl.org>
Thu, 3 Sep 2020 05:22:00 +0000 (07:22 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 8 Sep 2020 10:07:36 +0000 (12:07 +0200)
commitb968945204130620b1328f585610cbe1d6b5a69e
tree7d023da0175f9f3de0f9a40654daa7a316b4045e
parent86df26b3943509219057ae87f8764b3c15e0d8b8
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)
crypto/evp/pmeth_lib.c
test/recipes/30-test_evp_data/evppkey_sm2.txt