no-engine: fix signing with legacy app method based keys
authorMatthias St. Pierre <matthias.st.pierre@ncp-e.com>
Thu, 21 Sep 2023 14:43:43 +0000 (16:43 +0200)
committerTodd Short <todd.short@me.com>
Fri, 22 Sep 2023 19:21:10 +0000 (15:21 -0400)
commitc67a1988fcf8fe34b1d31e29849f2528d553dd66
tree5b166ab26534df0f4f534535a7c8e5e0f9f6c54b
parenta959bf8d9e37ee6ef79504d706bb5e481d0c1386
no-engine: fix signing with legacy app method based keys

Signing with an app method based key (i.e. an `EVP_PKEY` which wraps an
`RSA` key with an application defined `RSA_METHOD`) used to work in 1.1.1.
That feature was broken in commit 60488d2434, but later on fixed by @t8m
in commit b247113c05 (see #14859).

This commit corrects a  minor flaw of the fix, which affects only
`no-engine` builds: the special treatment for foreign keys is guarded
by an `OPENSSL_NO_ENGINE` check.

Reviewed-by: Tomas Mraz <tomas@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Dmitry Belyavskiy <beldmit@gmail.com>
Reviewed-by: Todd Short <todd.short@me.com>
(Merged from https://github.com/openssl/openssl/pull/22163)

(cherry picked from commit 1acc3e8cc3c69187b55cc557c1bc03278ab38063)
crypto/evp/pmeth_lib.c