diff options
author | jsing <> | 2021-01-09 03:51:42 +0000 |
---|---|---|
committer | jsing <> | 2021-01-09 03:51:42 +0000 |
commit | 6024e76ee2a1f06ab19a72b9a40a78aa7265d0a5 (patch) | |
tree | 3028736cca809e91e3c23b890a366bcfca1829d4 | |
parent | 3d1291ca74816105f206c083aa4f450ebb402fe6 (diff) | |
download | openbsd-6024e76ee2a1f06ab19a72b9a40a78aa7265d0a5.tar.gz openbsd-6024e76ee2a1f06ab19a72b9a40a78aa7265d0a5.tar.bz2 openbsd-6024e76ee2a1f06ab19a72b9a40a78aa7265d0a5.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@
-rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 4 |
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 | } |