Clear md_data only when necessary
authorMatt Caswell <matt@openssl.org>
Tue, 11 Jan 2022 17:13:39 +0000 (17:13 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 13 Jan 2022 11:50:40 +0000 (11:50 +0000)
commit8086b267fb3395c53cd5fc29eea68ba4826b333d
tree6b8fbe878cbceeffa44007c329645cc2fb254678
parent3d4d5305c292f5db62b4abf732f6682b2ada6f44
Clear md_data only when necessary

PR #17255 fixed a bug in EVP_DigestInit_ex(). While backporting the PR
to 1.1.1 (see #17472) I spotted an error in the original patch. This fixes
it.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Paul Dale <pauli@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/17473)
crypto/evp/digest.c