Only use the legacy route to decode a public key if we have to
authorMatt Caswell <matt@openssl.org>
Thu, 27 May 2021 15:48:37 +0000 (16:48 +0100)
committerMatt Caswell <matt@openssl.org>
Tue, 8 Jun 2021 17:53:28 +0000 (18:53 +0100)
commit29bf83c889c44236f33004ea2a6126c6d92e8b7a
treea33c72bb468b0eb55f4763bd54b9bede70871c10
parentf8da1d800580fb521b450b51f9e07ad1c3c1798d
Only use the legacy route to decode a public key if we have to

We should use a provider to decode a SubjectPublicKeyInfo structure if
we can. We should only use the legacy route if we are forcing legacy, or
if an ENGINE is in use.

Fixes #15393
Fixes #15327

Reviewed-by: Tomas Mraz <tomas@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/15504)
crypto/x509/x_pubkey.c