Blame doc/man3/SSL_check_chain.pod

Packit c4476c
=pod
Packit c4476c
Packit c4476c
=head1 NAME
Packit c4476c
Packit c4476c
SSL_check_chain - check certificate chain suitability
Packit c4476c
Packit c4476c
=head1 SYNOPSIS
Packit c4476c
Packit c4476c
 #include <openssl/ssl.h>
Packit c4476c
Packit c4476c
 int SSL_check_chain(SSL *s, X509 *x, EVP_PKEY *pk, STACK_OF(X509) *chain);
Packit c4476c
Packit c4476c
=head1 DESCRIPTION
Packit c4476c
Packit c4476c
SSL_check_chain() checks whether certificate B<x>, private key B<pk> and
Packit c4476c
certificate chain B<chain> is suitable for use with the current session
Packit c4476c
B<s>.
Packit c4476c
Packit c4476c
=head1 RETURN VALUES
Packit c4476c
Packit c4476c
SSL_check_chain() returns a bitmap of flags indicating the validity of the
Packit c4476c
chain.
Packit c4476c
Packit c4476c
B<CERT_PKEY_VALID>: the chain can be used with the current session.
Packit c4476c
If this flag is B<not> set then the certificate will never be used even
Packit c4476c
if the application tries to set it because it is inconsistent with the
Packit c4476c
peer preferences.
Packit c4476c
Packit c4476c
B<CERT_PKEY_SIGN>: the EE key can be used for signing.
Packit c4476c
Packit c4476c
B<CERT_PKEY_EE_SIGNATURE>: the signature algorithm of the EE certificate is
Packit c4476c
acceptable.
Packit c4476c
Packit c4476c
B<CERT_PKEY_CA_SIGNATURE>: the signature algorithms of all CA certificates
Packit c4476c
are acceptable.
Packit c4476c
Packit c4476c
B<CERT_PKEY_EE_PARAM>: the parameters of the end entity certificate are
Packit c4476c
acceptable (e.g. it is a supported curve).
Packit c4476c
Packit c4476c
B<CERT_PKEY_CA_PARAM>: the parameters of all CA certificates are acceptable.
Packit c4476c
Packit c4476c
B<CERT_PKEY_EXPLICIT_SIGN>: the end entity certificate algorithm
Packit c4476c
can be used explicitly for signing (i.e. it is mentioned in the signature
Packit c4476c
algorithms extension).
Packit c4476c
Packit c4476c
B<CERT_PKEY_ISSUER_NAME>: the issuer name is acceptable. This is only
Packit c4476c
meaningful for client authentication.
Packit c4476c
Packit c4476c
B<CERT_PKEY_CERT_TYPE>: the certificate type is acceptable. Only meaningful
Packit c4476c
for client authentication.
Packit c4476c
Packit c4476c
B<CERT_PKEY_SUITEB>: chain is suitable for Suite B use.
Packit c4476c
Packit c4476c
=head1 NOTES
Packit c4476c
Packit c4476c
SSL_check_chain() must be called in servers after a client hello message or in
Packit c4476c
clients after a certificate request message. It will typically be called
Packit c4476c
in the certificate callback.
Packit c4476c
Packit c4476c
An application wishing to support multiple certificate chains may call this
Packit c4476c
function on each chain in turn: starting with the one it considers the
Packit c4476c
most secure. It could then use the chain of the first set which returns
Packit c4476c
suitable flags.
Packit c4476c
Packit c4476c
As a minimum the flag B<CERT_PKEY_VALID> must be set for a chain to be
Packit c4476c
usable. An application supporting multiple chains with different CA signature
Packit c4476c
algorithms may also wish to check B<CERT_PKEY_CA_SIGNATURE> too. If no
Packit c4476c
chain is suitable a server should fall back to the most secure chain which
Packit c4476c
sets B<CERT_PKEY_VALID>.
Packit c4476c
Packit c4476c
The validity of a chain is determined by checking if it matches a supported
Packit c4476c
signature algorithm, supported curves and in the case of client authentication
Packit c4476c
certificate types and issuer names.
Packit c4476c
Packit c4476c
Since the supported signature algorithms extension is only used in TLS 1.2,
Packit c4476c
TLS 1.3 and DTLS 1.2 the results for earlier versions of TLS and DTLS may not
Packit c4476c
be very useful. Applications may wish to specify a different "legacy" chain
Packit c4476c
for earlier versions of TLS or DTLS.
Packit c4476c
Packit c4476c
=head1 SEE ALSO
Packit c4476c
Packit c4476c
L<SSL_CTX_set_cert_cb(3)>,
Packit c4476c
L<ssl(7)>
Packit c4476c
Packit c4476c
=head1 COPYRIGHT
Packit c4476c
Packit c4476c
Copyright 2015-2018 The OpenSSL Project Authors. All Rights Reserved.
Packit c4476c
Packit c4476c
Licensed under the OpenSSL license (the "License").  You may not use
Packit c4476c
this file except in compliance with the License.  You can obtain a copy
Packit c4476c
in the file LICENSE in the source distribution or at
Packit c4476c
L<https://www.openssl.org/source/license.html>.
Packit c4476c
Packit c4476c
=cut