Fix EVP_Digest{Sign,Verify}Final() and EVP_Digest{Sign,Verify}() for provider only...
authorRichard Levitte <levitte@openssl.org>
Fri, 10 Jan 2020 19:40:11 +0000 (20:40 +0100)
committerRichard Levitte <levitte@openssl.org>
Tue, 14 Jan 2020 13:04:34 +0000 (14:04 +0100)
commit8f020c3da571fd56c4a1ce16daad553193549a67
tree0bb4c31222d502fcb0e381f309ee7106dc9259ca
parentd3ac2eab6572e348cff33b02690e1177dcd6a4bd
Fix EVP_Digest{Sign,Verify}Final() and EVP_Digest{Sign,Verify}() for provider only keys

For provider only keys where the initialization didn't catch, we may
end up crashing because the legacy code path didn't check that it had
support carefully enough.  This only happens if the caller didn't
check if initialization worked or not.

For the one-shot case, it's very simply handling the case where the
key has no legacy implementation an fall back to the standard
init+update+final mechanism.

While at it, EVP_DigestSignFinal() and EVP_DigestVerifyFinal() got a
slight code cleanup.

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