EVP_DigestSign/VerifyFinal: Duplicate the pctx to allow multiple calls
authorTomas Mraz <tomas@openssl.org>
Wed, 25 Aug 2021 11:50:40 +0000 (13:50 +0200)
committerTomas Mraz <tomas@openssl.org>
Thu, 26 Aug 2021 14:06:57 +0000 (16:06 +0200)
commit78539b250b05d0721da775bf4eddc096bde5ecaa
tree1a1bef066384c4829417dbb1d333324a664397f3
parent62bae84d4587ec9a56d0ce830e36e4a5b2fa8a33
EVP_DigestSign/VerifyFinal: Duplicate the pctx to allow multiple calls

The legacy implementation duplicates the pctx before creating/verifying
the signature unless EVP_MD_CTX_FLAG_FINALISE is set. We have to do the
same with provided implementations.

Fixes #16321

Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16422)
crypto/evp/m_sigver.c
test/evp_extra_test.c