From 718563113a50e94a6425cdd51e05876a3d29a3ba Mon Sep 17 00:00:00 2001 From: tb <> Date: Wed, 1 Nov 2023 20:26:24 +0000 Subject: Explain the weird order of doing things in X509_ALGOR_set0() --- src/lib/libcrypto/asn1/x_algor.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 59e2adc928..76b78028ad 100644 --- a/src/lib/libcrypto/asn1/x_algor.c +++ b/src/lib/libcrypto/asn1/x_algor.c @@ -1,4 +1,4 @@ -/* $OpenBSD: x_algor.c,v 1.35 2023/11/01 20:25:27 tb Exp $ */ +/* $OpenBSD: x_algor.c,v 1.36 2023/11/01 20:26:24 tb Exp $ */ /* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL * project 2000. */ @@ -187,6 +187,7 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int parameter_type, if (alg == NULL) return 0; + /* Set parameter first to preserve public API behavior on failure. */ if (!X509_ALGOR_set0_parameter(alg, parameter_type, parameter_value)) return 0; -- cgit v1.2.3-55-g6feb