diff options
-rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 39f86d383e..763adda227 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.21 2020/11/16 17:42:35 jsing Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.22 2020/11/16 17:43:37 jsing Exp $ */ |
2 | /* | 2 | /* |
3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> | 3 | * Copyright (c) 2020 Bob Beck <beck@openbsd.org> |
4 | * | 4 | * |
@@ -1002,11 +1002,10 @@ x509_verify(struct x509_verify_ctx *ctx, X509 *leaf, char *name) | |||
1002 | * We could not find a validated chain, and for some reason do not | 1002 | * We could not find a validated chain, and for some reason do not |
1003 | * have an error set. | 1003 | * have an error set. |
1004 | */ | 1004 | */ |
1005 | if (ctx->chains_count == 0 && ctx->error == 0) { | 1005 | if (ctx->chains_count == 0 && ctx->error == X509_V_OK) { |
1006 | ctx->error = X509_V_ERR_UNSPECIFIED; | 1006 | ctx->error = X509_V_ERR_UNSPECIFIED; |
1007 | if (ctx->xsc != NULL && ctx->xsc->error != 0) | 1007 | if (ctx->xsc != NULL && ctx->xsc->error != X509_V_OK) |
1008 | ctx->error = ctx->xsc->error; | 1008 | ctx->error = ctx->xsc->error; |
1009 | |||
1010 | } | 1009 | } |
1011 | 1010 | ||
1012 | /* Clear whatever errors happened if we have any validated chain */ | 1011 | /* Clear whatever errors happened if we have any validated chain */ |