diff options
Diffstat (limited to 'src/lib/libcrypto/asn1/x_algor.c')
-rw-r--r-- | src/lib/libcrypto/asn1/x_algor.c | 31 |
1 files changed, 30 insertions, 1 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c index 76b78028ad..5ad1263b27 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.36 2023/11/01 20:26:24 tb Exp $ */ | 1 | /* $OpenBSD: x_algor.c,v 1.37 2023/11/01 20:37:42 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,6 +159,19 @@ X509_ALGOR_set0_obj(X509_ALGOR *alg, ASN1_OBJECT *aobj) | |||
159 | } | 159 | } |
160 | 160 | ||
161 | static int | 161 | static int |
162 | X509_ALGOR_set_obj_by_nid(X509_ALGOR *alg, int nid) | ||
163 | { | ||
164 | ASN1_OBJECT *aobj; | ||
165 | |||
166 | if ((aobj = OBJ_nid2obj(nid)) == NULL) | ||
167 | return 0; | ||
168 | if (!X509_ALGOR_set0_obj(alg, aobj)) | ||
169 | return 0; | ||
170 | |||
171 | return 1; | ||
172 | } | ||
173 | |||
174 | static int | ||
162 | X509_ALGOR_set0_parameter(X509_ALGOR *alg, int parameter_type, | 175 | X509_ALGOR_set0_parameter(X509_ALGOR *alg, int parameter_type, |
163 | void *parameter_value) | 176 | void *parameter_value) |
164 | { | 177 | { |
@@ -181,6 +194,22 @@ X509_ALGOR_set0_parameter(X509_ALGOR *alg, int parameter_type, | |||
181 | } | 194 | } |
182 | 195 | ||
183 | int | 196 | int |
197 | X509_ALGOR_set0_by_nid(X509_ALGOR *alg, int nid, int parameter_type, | ||
198 | void *parameter_value) | ||
199 | { | ||
200 | if (alg == NULL) | ||
201 | return 0; | ||
202 | |||
203 | if (!X509_ALGOR_set_obj_by_nid(alg, nid)) | ||
204 | return 0; | ||
205 | |||
206 | if (!X509_ALGOR_set0_parameter(alg, parameter_type, parameter_value)) | ||
207 | return 0; | ||
208 | |||
209 | return 1; | ||
210 | } | ||
211 | |||
212 | int | ||
184 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int parameter_type, | 213 | X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int parameter_type, |
185 | void *parameter_value) | 214 | void *parameter_value) |
186 | { | 215 | { |