From: tb Date: Wed, 1 Nov 2023 20:26:24 +0000 (+0000) Subject: Explain the weird order of doing things in X509_ALGOR_set0() X-Git-Url: http://artulab.com/gitweb/?a=commitdiff_plain;h=4c3df036cdefb2caac7ade08cbb08eb9b1c93075;p=openbsd Explain the weird order of doing things in X509_ALGOR_set0() --- diff --git a/lib/libcrypto/asn1/x_algor.c b/lib/libcrypto/asn1/x_algor.c index 59e2adc9282..76b78028ad5 100644 --- a/lib/libcrypto/asn1/x_algor.c +++ b/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;