Fix SSL_check_chain()
authorMatt Caswell <matt@openssl.org>
Tue, 23 Jul 2019 14:14:29 +0000 (15:14 +0100)
committerMatt Caswell <matt@openssl.org>
Fri, 9 Aug 2019 16:29:39 +0000 (17:29 +0100)
The function SSL_check_chain() can be used by applications to check that
a cert and chain is compatible with the negotiated parameters. This could
be useful (for example) from the certificate callback. Unfortunately this
function was applying TLSv1.2 sig algs rules and did not work correctly if
TLSv1.3 was negotiated.

We refactor tls_choose_sigalg to split it up and create a new function
find_sig_alg which can (optionally) take a certificate and key as
parameters and find an appropriate sig alg if one exists. If the cert and
key are not supplied then we try to find a cert and key from the ones we
have available that matches the shared sig algs.

Reviewed-by: Tomas Mraz <tmraz@fedoraproject.org>
(Merged from https://github.com/openssl/openssl/pull/9442)


No differences found