diff options
author | Theo Buehler <tb@cvs.openbsd.org> | 2020-10-26 11:56:37 +0000 |
---|---|---|
committer | Theo Buehler <tb@cvs.openbsd.org> | 2020-10-26 11:56:37 +0000 |
commit | cdd02dc672e3718149bf5f5d340e9c11f659cc54 (patch) | |
tree | 7f9b4143cbbdfac14bc5b658c22e3a0b5ccb765e /lib | |
parent | 57b129942c293d298ad4d7bb7426d528d07dbc84 (diff) |
Make sure that x509_vfy_check_id() failure also sets ctx->error, not only
ctx->xsc->error. Will be needed in an upcoming diff.
from beck
Diffstat (limited to 'lib')
-rw-r--r-- | lib/libcrypto/x509/x509_verify.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/lib/libcrypto/x509/x509_verify.c b/lib/libcrypto/x509/x509_verify.c index 0c32cd04b74..fdde098df7a 100644 --- a/lib/libcrypto/x509/x509_verify.c +++ b/lib/libcrypto/x509/x509_verify.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x509_verify.c,v 1.13 2020/09/26 15:44:06 jsing Exp $ */ +/* $OpenBSD: x509_verify.c,v 1.14 2020/10/26 11:56:36 tb Exp $ */ /* * Copyright (c) 2020 Bob Beck <beck@openbsd.org> * @@ -458,8 +458,13 @@ x509_verify_cert_hostname(struct x509_verify_ctx *ctx, X509 *cert, char *name) size_t len; if (name == NULL) { - if (ctx->xsc != NULL) - return x509_vfy_check_id(ctx->xsc); + if (ctx->xsc != NULL) { + int ret; + + if ((ret = x509_vfy_check_id(ctx->xsc)) == 0) + ctx->error = ctx->xsc->error; + return ret; + } return 1; } if ((candidate = strdup(name)) == NULL) { |