Handle the case where there is no digest in an EVP_MD_CTX
authorMatt Caswell <matt@openssl.org>
Thu, 12 Mar 2020 10:55:51 +0000 (10:55 +0000)
committerMatt Caswell <matt@openssl.org>
Thu, 19 Mar 2020 11:39:39 +0000 (11:39 +0000)
commita2b6231601c384bba043755bb58d500265ff6f1e
treee9c7d92ec4f4c826803eb6953860f4c610bc4d91
parent8658feddea6aef5cf5cbb1cfbf6b1817fa432051
Handle the case where there is no digest in an EVP_MD_CTX

EVP_MD_CTX_ctrl assumes that a digest has always been set. However in a
non-legacy EVP_DigestSign* operation this is not the case because the
digest is handled entirely by the underlying signature implementation.

This fixes one of the travis failures on the master branch.

[extended tests]

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/11317)
crypto/evp/digest.c