openssl/ssl
Viktor Dukhovni c0a445a9f2 Suppress DANE TLSA reflection when verification fails
As documented both SSL_get0_dane_authority() and SSL_get0_dane_tlsa()
are expected to return a negative match depth and nothing else when
verification fails.  However, this only happened when verification
failed during chain construction.  Errors in verification of the
constructed chain did not have the intended effect on these functions.

This commit updates the functions to check for verify_result ==
X509_V_OK, and no longer erases any accumulated match information
when chain construction fails.  Sophisticated developers can, with
care, use SSL_set_verify_result(ssl, X509_V_OK) to "peek" at TLSA
info even when verification fail.  They must of course first check
and save the real error, and restore the original error as quickly
as possible.  Hiding by default seems to be the safer interface.

Introduced X509_V_ERR_DANE_NO_MATCH code to signal failure to find
matching TLSA records.  Previously reported via X509_V_ERR_CERT_UNTRUSTED.

This also changes the "-brief" output from s_client to include
verification results and TLSA match information.

Mentioned session resumption in code example in SSL_CTX_dane_enable(3).
Also mentioned that depths returned are relative to the verified chain
which is now available via SSL_get0_verified_chain(3).

Added a few more test-cases to danetest, that exercise the new
code.

Resolved thread safety issue in use of static buffer in
X509_verify_cert_error_string().

Fixed long-stating issue in apps/s_cb.c which always sets verify_error
to either X509_V_OK or "chain to long", code elsewhere (e.g.
s_time.c), seems to expect the actual error.  [ The new chain
construction code is expected to correctly generate "chain
too long" errors, so at some point we need to drop the
work-arounds, once SSL_set_verify_depth() is also fixed to
propagate the depth to X509_STORE_CTX reliably. ]

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-08 14:46:09 -05:00
..
record Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
statem GH601: Various spelling fixes. 2016-02-05 15:25:50 -05:00
bio_ssl.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
build.info unified build scheme: add build.info files 2016-02-01 12:46:58 +01:00
d1_lib.c Add tests for DTLSv1_listen 2016-02-05 20:47:36 +00:00
d1_msg.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
d1_srtp.c Add new DTLS-SRTP protection profiles from RFC 7714 2016-02-04 22:52:21 +00:00
install-ssl.com Updates following review comments 2015-05-16 09:20:52 +01:00
Makefile.in Templatize util/domd 2016-01-29 16:56:07 -05:00
methods.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
packet_locl.h constify PACKET 2016-02-01 16:21:57 +01:00
pqueue.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
s3_cbc.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
s3_enc.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
s3_lib.c Deprecate undocumented SSL_cache_hit(). 2016-02-08 16:57:07 +00:00
s3_msg.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_algs.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_asn1.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_cert.c Add SSL_get0_verified_chain() to return verified chain of peer 2016-02-06 18:18:28 +00:00
ssl_ciph.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_conf.c Restore -no_comp switch for backwards compatible behaviour 2016-02-05 11:00:53 -05:00
ssl_err2.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_err.c Handle SSL_shutdown while in init more appropriately #2 2016-02-08 09:29:29 +00:00
ssl_lib.c Suppress DANE TLSA reflection when verification fails 2016-02-08 14:46:09 -05:00
ssl_locl.h Add SSL_get0_verified_chain() to return verified chain of peer 2016-02-06 18:18:28 +00:00
ssl_mcnf.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_rsa.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_sess.c constify PACKET 2016-02-01 16:21:57 +01:00
ssl_stat.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_txt.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl_utst.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
ssl-lib.com Move SSLv3_*method() functions 2015-05-16 09:20:58 +01:00
t1_enc.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
t1_ext.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
t1_lib.c constify PACKET 2016-02-01 16:21:57 +01:00
t1_reneg.c constify PACKET 2016-02-01 16:21:57 +01:00
t1_trce.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00
tls_srp.c Remove /* foo.c */ comments 2016-01-26 16:40:43 -05:00