summaryrefslogtreecommitdiff
path: root/src/lib/libssl/ssl_both.c
diff options
context:
space:
mode:
authorjsing <>2021-01-05 17:14:46 +0000
committerjsing <>2021-01-05 17:14:46 +0000
commit8e8301ad47bf0a141d94094f633bb082f23966a0 (patch)
tree14ec37dc6236f10143f0da4e09ebccf7dfea8cfb /src/lib/libssl/ssl_both.c
parent6c7a19527207c9facce4fe2c51bab20e5ccf1ceb (diff)
downloadopenbsd-8e8301ad47bf0a141d94094f633bb082f23966a0.tar.gz
openbsd-8e8301ad47bf0a141d94094f633bb082f23966a0.tar.bz2
openbsd-8e8301ad47bf0a141d94094f633bb082f23966a0.zip
Use legacy verifier when building auto chains.
The new verifier builds all chains, starting with the shortest possible path. It also does not currently return partial chains. Both of these things conflict with auto chain, where we want to build the longest possible chain (to include all intermediates, and probably the root unnecessarily), as well as using an incomplete chain when a trusted chain is not known. Depending on software configuration, we can end up building a chain consisting only of a leaf certificate, rather than a longer chain. This results in auto chain not including intermediates, which is undesireable. For now, switch auto chain building to use the legacy verifier. This should resolve the issues encountered by ajacoutot@ with sendmail. ok tb@
Diffstat (limited to 'src/lib/libssl/ssl_both.c')
-rw-r--r--src/lib/libssl/ssl_both.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libssl/ssl_both.c b/src/lib/libssl/ssl_both.c
index 081b374396..6480b45bec 100644
--- a/src/lib/libssl/ssl_both.c
+++ b/src/lib/libssl/ssl_both.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: ssl_both.c,v 1.21 2020/10/14 16:57:33 jsing Exp $ */ 1/* $OpenBSD: ssl_both.c,v 1.22 2021/01/05 17:14:46 jsing Exp $ */
2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) 2/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
3 * All rights reserved. 3 * All rights reserved.
4 * 4 *
@@ -408,6 +408,8 @@ ssl3_output_cert_chain(SSL *s, CBB *cbb, CERT_PKEY *cpk)
408 SSLerror(s, ERR_R_X509_LIB); 408 SSLerror(s, ERR_R_X509_LIB);
409 goto err; 409 goto err;
410 } 410 }
411 X509_VERIFY_PARAM_set_flags(X509_STORE_CTX_get0_param(xs_ctx),
412 X509_V_FLAG_LEGACY_VERIFY);
411 X509_verify_cert(xs_ctx); 413 X509_verify_cert(xs_ctx);
412 ERR_clear_error(); 414 ERR_clear_error();
413 chain = xs_ctx->chain; 415 chain = xs_ctx->chain;