evp: detect and raise an error if no digest is found for a sign/verify operation
authorPauli <pauli@openssl.org>
Wed, 7 Jul 2021 06:32:16 +0000 (16:32 +1000)
committerPauli <pauli@openssl.org>
Thu, 8 Jul 2021 10:22:21 +0000 (20:22 +1000)
commite278127cbfa2709d864ca9628a8ddb160c5c5331
tree38681a2785da6d18108e40b3864e6ada95df8614
parentdaf4b2437f38bd104400517cf8ff2c8121813b1a
evp: detect and raise an error if no digest is found for a sign/verify operation

If no digest is specified, the code looks for a default digest per PKEY via the
evp_keymgmt_util_get_deflt_digest_name() call.  If this call returns NULL,
indicating no digest found, the code continues regardless.  If the verify/sign
init later fails, it returns an error without raising one.  This change raises
an error in this case.

Fixes #15372

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/16015)
crypto/evp/m_sigver.c