diff options
| author | jsing <> | 2021-02-25 16:57:10 +0000 |
|---|---|---|
| committer | jsing <> | 2021-02-25 16:57:10 +0000 |
| commit | 4809c4fa82f7c39c5645f15fb695f8fb77daf8b2 (patch) | |
| tree | 0b004f76d247999407645e8028b6bd602d269222 /src | |
| parent | 052d36f8658e248c066384b08c925f65e7074586 (diff) | |
| download | openbsd-4809c4fa82f7c39c5645f15fb695f8fb77daf8b2.tar.gz openbsd-4809c4fa82f7c39c5645f15fb695f8fb77daf8b2.tar.bz2 openbsd-4809c4fa82f7c39c5645f15fb695f8fb77daf8b2.zip | |
Avoid passing last and depth to x509_verify_cert_error() on ENOMEM.
In x509_verify_ctx_set_xsc_chain(), an ENOMEM case is currently passing
the last certificate and depth (which is no longer actually depth) to
x509_verify_cert_error(). Given we've hit an ENOMEM situation, neither
of these are useful so remove both.
ok tb@
Diffstat (limited to 'src')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 598e268d37..62cbb7cef8 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.31 2021/02/24 17:59:05 tb Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.32 2021/02/25 16:57:10 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 | * |
| @@ -197,7 +197,6 @@ static int | |||
| 197 | x509_verify_ctx_set_xsc_chain(struct x509_verify_ctx *ctx, | 197 | x509_verify_ctx_set_xsc_chain(struct x509_verify_ctx *ctx, |
| 198 | struct x509_verify_chain *chain, int set_error, int is_trusted) | 198 | struct x509_verify_chain *chain, int set_error, int is_trusted) |
| 199 | { | 199 | { |
| 200 | X509 *last = x509_verify_chain_last(chain); | ||
| 201 | size_t depth; | 200 | size_t depth; |
| 202 | int i; | 201 | int i; |
| 203 | 202 | ||
| @@ -218,7 +217,7 @@ x509_verify_ctx_set_xsc_chain(struct x509_verify_ctx *ctx, | |||
| 218 | sk_X509_pop_free(ctx->xsc->chain, X509_free); | 217 | sk_X509_pop_free(ctx->xsc->chain, X509_free); |
| 219 | ctx->xsc->chain = X509_chain_up_ref(chain->certs); | 218 | ctx->xsc->chain = X509_chain_up_ref(chain->certs); |
| 220 | if (ctx->xsc->chain == NULL) | 219 | if (ctx->xsc->chain == NULL) |
| 221 | return x509_verify_cert_error(ctx, last, depth, | 220 | return x509_verify_cert_error(ctx, NULL, 0, |
| 222 | X509_V_ERR_OUT_OF_MEM, 0); | 221 | X509_V_ERR_OUT_OF_MEM, 0); |
| 223 | 222 | ||
| 224 | if (set_error) { | 223 | if (set_error) { |
