Blame doc/man3/SSL_check_chain.pod

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