summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/lib/libcrypto/asn1/x_algor.c16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c
index c0bc41dd34..59e2adc928 100644
--- a/src/lib/libcrypto/asn1/x_algor.c
+++ b/src/lib/libcrypto/asn1/x_algor.c
@@ -1,4 +1,4 @@
1/* $OpenBSD: x_algor.c,v 1.34 2023/11/01 20:22:24 tb Exp $ */ 1/* $OpenBSD: x_algor.c,v 1.35 2023/11/01 20:25:27 tb Exp $ */
2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL 2/* Written by Dr Stephen N Henson (steve@openssl.org) for the OpenSSL
3 * project 2000. 3 * project 2000.
4 */ 4 */
@@ -159,9 +159,10 @@ X509_ALGOR_set0_obj(X509_ALGOR *alg, ASN1_OBJECT *aobj)
159} 159}
160 160
161static int 161static int
162X509_ALGOR_set0_parameter(X509_ALGOR *alg, int ptype, void *pval) 162X509_ALGOR_set0_parameter(X509_ALGOR *alg, int parameter_type,
163 void *parameter_value)
163{ 164{
164 if (ptype == V_ASN1_UNDEF) { 165 if (parameter_type == V_ASN1_UNDEF) {
165 ASN1_TYPE_free(alg->parameter); 166 ASN1_TYPE_free(alg->parameter);
166 alg->parameter = NULL; 167 alg->parameter = NULL;
167 168
@@ -173,19 +174,20 @@ X509_ALGOR_set0_parameter(X509_ALGOR *alg, int ptype, void *pval)
173 if (alg->parameter == NULL) 174 if (alg->parameter == NULL)
174 return 0; 175 return 0;
175 176
176 if (ptype != 0) 177 if (parameter_type != 0)
177 ASN1_TYPE_set(alg->parameter, ptype, pval); 178 ASN1_TYPE_set(alg->parameter, parameter_type, parameter_value);
178 179
179 return 1; 180 return 1;
180} 181}
181 182
182int 183int
183X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) 184X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int parameter_type,
185 void *parameter_value)
184{ 186{
185 if (alg == NULL) 187 if (alg == NULL)
186 return 0; 188 return 0;
187 189
188 if (!X509_ALGOR_set0_parameter(alg, ptype, pval)) 190 if (!X509_ALGOR_set0_parameter(alg, parameter_type, parameter_value))
189 return 0; 191 return 0;
190 192
191 if (!X509_ALGOR_set0_obj(alg, aobj)) 193 if (!X509_ALGOR_set0_obj(alg, aobj))