diff options
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index d91efe9323..869625036a 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.32 2023/11/01 20:14:51 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.33 2023/11/01 20:19:16 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 | */ |
@@ -158,12 +158,9 @@ X509_ALGOR_set0_obj(X509_ALGOR *alg, ASN1_OBJECT *aobj) | |||
158 | return 1; | 158 | return 1; |
159 | } | 159 | } |
160 | 160 | ||
161 | int | 161 | static int |
162 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | 162 | X509_ALGOR_set0_parameter(X509_ALGOR *alg, int ptype, void *pval) |
163 | { | 163 | { |
164 | if (alg == NULL) | ||
165 | return 0; | ||
166 | |||
167 | if (ptype == V_ASN1_UNDEF) { | 164 | if (ptype == V_ASN1_UNDEF) { |
168 | ASN1_TYPE_free(alg->parameter); | 165 | ASN1_TYPE_free(alg->parameter); |
169 | alg->parameter = NULL; | 166 | alg->parameter = NULL; |
@@ -176,6 +173,18 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | |||
176 | ASN1_TYPE_set(alg->parameter, ptype, pval); | 173 | ASN1_TYPE_set(alg->parameter, ptype, pval); |
177 | } | 174 | } |
178 | 175 | ||
176 | return 1; | ||
177 | } | ||
178 | |||
179 | int | ||
180 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval) | ||
181 | { | ||
182 | if (alg == NULL) | ||
183 | return 0; | ||
184 | |||
185 | if (!X509_ALGOR_set0_parameter(alg, ptype, pval)) | ||
186 | return 0; | ||
187 | |||
179 | if (!X509_ALGOR_set0_obj(alg, aobj)) | 188 | if (!X509_ALGOR_set0_obj(alg, aobj)) |
180 | return 0; | 189 | return 0; |
181 | 190 | ||