openssl/util
Dr. David von Oheimb 0c3eb2793b TLS client: allow cert verify callback return -1 for SSL_ERROR_WANT_RETRY_VERIFY
The client-side cert verification callback function may not only return
as usual for success or 0 for failure, but also -1,
typically on failure verifying the server certificate.
This makes the handshake suspend and return control to the calling application
with SSL_ERROR_WANT_RETRY_VERIFY.
The app can for instance fetch further certificates or cert status information
needed for the verification.
Calling SSL_connect() again resumes the connection attempt
by retrying the server certificate verification step.
This process may even be repeated if need be.

The core implementation of the feature is in ssl/statem/statem_clnt.c,
splitting tls_process_server_certificate() into a preparation step
that just copies the certificates received from the server to s->session->peer_chain
(rather than having them in a local variable at first) and returns to the state machine,
and a post-processing step in tls_post_process_server_certificate() that can be repeated:
Try verifying the current contents of s->session->peer_chain basically as before,
but give the verification callback function the chance to pause connecting and
make the TLS state machine later call tls_post_process_server_certificate() again.
Otherwise processing continues as usual.

The documentation of the new feature is added to SSL_CTX_set_cert_verify_callback.pod
and SSL_want.pod.

This adds two tests:
* A generic test in test/helpers/handshake.c
  on the usability of the new server cert verification retry feature.
  It is triggered via test/ssl-tests/03-custom_verify.cnf.in (while the bulky auto-
  generated changes to test/ssl-tests/03-custom_verify.cnf can be basically ignored).
* A test in test/sslapitest.c that demonstrates the effectiveness of the approach
  for augmenting the cert chain provided by the server in between SSL_connect() calls.

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/13906)
2021-01-26 17:09:13 +01:00
..
perl Util/Pod.pm: Fix uninitialized $podinfo{lastsecttext} on empty input 2021-01-23 15:25:04 +01:00
add-depends.pl
build.info
cavs-to-evptest.pl
check-format-test-negatives.c util/check-format.pl: Minor improvements of whitespace checks 2021-01-19 17:23:39 +01:00
check-format-test-positives.c util/check-format.pl: Minor improvements of whitespace checks 2021-01-19 17:23:39 +01:00
check-format.pl util/check-format.pl: Minor improvements of whitespace checks 2021-01-19 17:23:39 +01:00
check-malloc-errs
ck_errf.pl
copy.pl
dofile.pl configdata.pm.in, util/dofile.pl: Make a HERE document stricter. 2020-10-27 10:17:19 +01:00
echo.pl
engines.num
err-to-raise Simplify util/err-to-raise 2020-11-18 11:40:52 +01:00
find-doc-nits fall-back -> fallback find-doc-nit addition 2021-01-21 17:05:19 +01:00
find-unused-errs
fix-deprecation util/fix-deprecation: DEPRECATEDIN conversion util for public headers 2020-11-20 20:55:03 +01:00
fix-includes
fix-includes.sed
indent.pro Deprecate OCSP_xxx API for OSSL_HTTP_xxx 2021-01-19 11:13:15 +01:00
libcrypto.num Add EVP_PKEY functions to get EC conv form and field type 2021-01-26 15:26:17 +01:00
libssl.num Adding TLS group name retrieval 2021-01-08 17:04:46 +00:00
local_shlib.com.in
markdownlint.rb
merge-err-lines
missingcrypto111.txt APPS: Allow OPENSSL_CONF to be empty, not loading a config file 2021-01-13 11:53:15 +01:00
missingcrypto-internal.txt STORE: Move the built-in 'file:' loader to become an engine module 2020-09-03 17:48:32 +02:00
missingcrypto.txt Deprecate OCSP_xxx API for OSSL_HTTP_xxx 2021-01-19 11:13:15 +01:00
missingmacro111.txt Document some SSL DH related functions/macros 2020-11-18 14:14:53 +00:00
missingmacro.txt Add X509V3_set_issuer_pkey, needed for AKID of self-issued not self-signed cert 2021-01-13 11:53:15 +01:00
missingssl111.txt
missingssl-internal.txt
missingssl.txt
mkbuildinf.pl
mkdef.pl Build: Make NonStop shared libraries only export selected symbols 2020-09-25 12:05:47 +02:00
mkdir-p.pl
mkerr.pl ERR: Modify util/mkerr.pl to produce internal err string loaders 2020-11-24 15:18:29 +01:00
mknum.pl Update copyright year 2020-10-15 14:10:06 +01:00
mkpod2html.pl
mkrc.pl util/mkrc.pl: Make sure FILEVERSION and PRODUCTVERSION have four numbers 2020-11-17 13:18:16 +01:00
mktar.sh Simplify the tarball generating scripts 2020-09-24 08:03:00 +02:00
opensslwrap.sh
other-internal.syms
other.syms TLS client: allow cert verify callback return -1 for SSL_ERROR_WANT_RETRY_VERIFY 2021-01-26 17:09:13 +01:00
providers.num
shlib_wrap.sh.in
su-filter.pl
unlocal_shlib.com.in
withlibctx.pl Perl util to do with_libctx renaming 2020-10-01 09:23:05 +01:00
wrap.pl