Take away bogus error assignment before callback call.
authorbeck <beck@openbsd.org>
Tue, 28 Jun 2022 16:05:42 +0000 (16:05 +0000)
committerbeck <beck@openbsd.org>
Tue, 28 Jun 2022 16:05:42 +0000 (16:05 +0000)
Keep the depth which was needed.

This went an error too far, and broke openssl-ruby's callback
and error code sensitivity in it's tests.

With this removed, both my newly committed regress to verify
the same error codes and depths in the callback, and
openssl-ruby's tests pass again.

ok tb@

lib/libcrypto/x509/x509_verify.c

index aa14bc1..a9c54e6 100644 (file)
@@ -1,4 +1,4 @@
-/* $OpenBSD: x509_verify.c,v 1.58 2022/06/28 07:56:34 beck Exp $ */
+/* $OpenBSD: x509_verify.c,v 1.59 2022/06/28 16:05:42 beck Exp $ */
 /*
  * Copyright (c) 2020-2021 Bob Beck <beck@openbsd.org>
  *
@@ -1193,7 +1193,6 @@ x509_verify(struct x509_verify_ctx *ctx, X509 *leaf, char *name)
                                 * on failure and will be needed for
                                 * that.
                                 */
-                               ctx->xsc->error = ctx->error;
                                ctx->xsc->error_depth = ctx->error_depth;
                                if (!x509_verify_ctx_save_xsc_error(ctx)) {
                                        x509_verify_chain_free(current_chain);