diff options
author | beck <> | 2021-09-09 15:09:43 +0000 |
---|---|---|
committer | beck <> | 2021-09-09 15:09:43 +0000 |
commit | aa0e235cc622d59a481b0c6ac071a1ccaec2503e (patch) | |
tree | 4f990b9300ad5988f68721e1f93748df0723f5f0 /src/lib | |
parent | 4478497c199d0591f761a4d63fc368cfb3a2cb70 (diff) | |
download | openbsd-aa0e235cc622d59a481b0c6ac071a1ccaec2503e.tar.gz openbsd-aa0e235cc622d59a481b0c6ac071a1ccaec2503e.tar.bz2 openbsd-aa0e235cc622d59a481b0c6ac071a1ccaec2503e.zip |
When calling the legacy callback, ensure we catch the case where it
has decided to change a succeess to a failure and change the error code.
Fixes a regression in the openssl-ruby tests which expect to test this
functionality.
ok tb@
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/x509/x509_verify.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/lib/libcrypto/x509/x509_verify.c b/src/lib/libcrypto/x509/x509_verify.c index 2ec53f6fc8..e49fbdee48 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.48 2021/09/03 08:58:53 beck Exp $ */ | 1 | /* $OpenBSD: x509_verify.c,v 1.49 2021/09/09 15:09:43 beck 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 | * |
@@ -1205,8 +1205,11 @@ x509_verify(struct x509_verify_ctx *ctx, X509 *leaf, char *name) | |||
1205 | * verified chain. The callback could still tell us to | 1205 | * verified chain. The callback could still tell us to |
1206 | * fail. | 1206 | * fail. |
1207 | */ | 1207 | */ |
1208 | if(!x509_vfy_callback_indicate_success(ctx->xsc)) | 1208 | if(!x509_vfy_callback_indicate_success(ctx->xsc)) { |
1209 | /* The callback can change the error code */ | ||
1210 | ctx->error = ctx->xsc->error; | ||
1209 | goto err; | 1211 | goto err; |
1212 | } | ||
1210 | } else { | 1213 | } else { |
1211 | /* | 1214 | /* |
1212 | * We had a failure, indicate the failure, but | 1215 | * We had a failure, indicate the failure, but |