EVP_DigestInit_ex(): drop previous context engine earlier
authorRichard Levitte <levitte@openssl.org>
Tue, 4 Jun 2019 14:15:46 +0000 (16:15 +0200)
committerRichard Levitte <levitte@openssl.org>
Tue, 4 Jun 2019 15:34:30 +0000 (17:34 +0200)
commit98475995e1835f20ac4f4b83ec90a3e36fdb0861
tree72fe85b4d528d0094e91f45d68fcde958b51167f
parentf308fa2573b0320236cd2c2d73db37c49e3eb779
EVP_DigestInit_ex(): drop previous context engine earlier

If a EVP_MD_CTX holds a reference to a previously given engine, and
the type of its digest isn't the same as the one given in the new
call, drop that engine reference, allowing providers or other engines
to provide the new algorithm on an equal basis.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/9077)
crypto/evp/digest.c