summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/libcrypto/asn1/x_algor.c32
1 files changed, 19 insertions, 13 deletions
diff --git a/src/lib/libcrypto/asn1/x_algor.c b/src/lib/libcrypto/asn1/x_algor.c
index 092ad80d2d..47bde7b97e 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.27 2023/10/11 13:05:18 tb Exp $ */ 1/* $OpenBSD: x_algor.c,v 1.28 2023/10/11 13:10:13 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 */
@@ -176,20 +176,26 @@ X509_ALGOR_set0(X509_ALGOR *alg, ASN1_OBJECT *aobj, int ptype, void *pval)
176} 176}
177 177
178void 178void
179X509_ALGOR_get0(const ASN1_OBJECT **paobj, int *pptype, const void **ppval, 179X509_ALGOR_get0(const ASN1_OBJECT **out_aobj, int *out_type,
180 const X509_ALGOR *algor) 180 const void **out_value, const X509_ALGOR *alg)
181{ 181{
182 if (paobj) 182 int type = V_ASN1_UNDEF;
183 *paobj = algor->algorithm; 183 const void *value = NULL;
184 if (pptype) { 184
185 if (algor->parameter == NULL) { 185 if (out_aobj != NULL)
186 *pptype = V_ASN1_UNDEF; 186 *out_aobj = alg->algorithm;
187 return; 187
188 } else 188 if (out_type == NULL)
189 *pptype = algor->parameter->type; 189 return;
190 if (ppval) 190
191 *ppval = algor->parameter->value.ptr; 191 if (alg->parameter != NULL) {
192 type = alg->parameter->type;
193 value = alg->parameter->value.ptr;
192 } 194 }
195
196 *out_type = type;
197 if (out_value != NULL)
198 *out_value = value;
193} 199}
194 200
195int 201int