summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorjsing <>2021-01-09 03:51:42 +0000
committerjsing <>2021-01-09 03:51:42 +0000
commitdb775750bba784709065840e19dad04ececcf5ff (patch)
tree3028736cca809e91e3c23b890a366bcfca1829d4 /src
parent8eb1ac38c523889ebcc41441d6291f6c98fa46a8 (diff)
downloadopenbsd-db775750bba784709065840e19dad04ececcf5ff.tar.gz
openbsd-db775750bba784709065840e19dad04ececcf5ff.tar.bz2
openbsd-db775750bba784709065840e19dad04ececcf5ff.zip
Set chain on xsc on chain build failure.
Prior to calling the callback, ensure that the current (invalid and likely incomplete) chain is set on the xsc. Some things (like auto chain) depend on this functionality. ok beck@
Diffstat (limited to 'src')
-rw-r--r--src/lib/libcrypto/x509/x509_verify.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c
index d343706ea1..cf0d7fb559 100644
--- a/src/lib/libcrypto/x509/x509_verify.c
+++ b/src/lib/libcrypto/x509/x509_verify.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x509_verify.c,v 1.29 2021/01/09 03:01:03 beck Exp $ */ 1/* $OpenBSD: x509_verify.c,v 1.30 2021/01/09 03:51:42 jsing Exp $ */
2/* 2/*
3 * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org> 3 * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org>
4 * 4 *
@@ -555,6 +555,8 @@ x509_verify_build_chains(struct x509_verify_ctx *ctx, X509 *cert,
555 if (depth == 0 && 555 if (depth == 0 &&
556 ctx->error == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY) 556 ctx->error == X509_V_ERR_UNABLE_TO_GET_ISSUER_CERT_LOCALLY)
557 ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE; 557 ctx->error = X509_V_ERR_UNABLE_TO_VERIFY_LEAF_SIGNATURE;
558 if (!x509_verify_ctx_set_xsc_chain(ctx, current_chain, 0))
559 return;
558 (void) x509_verify_cert_error(ctx, cert, depth, 560 (void) x509_verify_cert_error(ctx, cert, depth,
559 ctx->error, 0); 561 ctx->error, 0);
560 } 562 }