Support calling EVP_DigestUpdate instead of EVP_Digest[Sign|Verify]Update
authorMatt Caswell <matt@openssl.org>
Mon, 7 Oct 2019 16:47:04 +0000 (17:47 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 11 Oct 2019 10:42:43 +0000 (11:42 +0100)
commit72df8f8825d54a7f1be48cc9035f4e3a86f639b4
treef87744718e29ab032a9dffac989057a4d484924c
parentbc3a1377366b2465cebfb61032c1e864c6bbf665
Support calling EVP_DigestUpdate instead of EVP_Digest[Sign|Verify]Update

Prior to OpenSSL 3.0 EVP_Digest[Sign|Verify|Update were just macros for
EVP_DigestUpdate. They are now separate functions. Unfortunately some
code assumes that EVP_Digest[Sign|Verify]Update is interchangeable with
EVP_DigestUpdate. For example the dgst app uses an MD bio which always
calls EVP_DigestUpdate(). However the dgst app supports signing instead
of digesting and may initialise with EVP_DigestSignInit_ex() instead of
just EVP_DigestInit().

We now detect these differences and redirect to the correct function
where appropriate.

Fixes #10114

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/10116)
crypto/evp/build.info
crypto/evp/digest.c
crypto/evp/m_sigver.c