diff options
Diffstat (limited to '')
| -rw-r--r-- | src/lib/libcrypto/x509/x509_req.c | 16 | 
1 files changed, 6 insertions, 10 deletions
| diff --git a/src/lib/libcrypto/x509/x509_req.c b/src/lib/libcrypto/x509/x509_req.c index cbf731cc5a..e7f871449f 100644 --- a/src/lib/libcrypto/x509/x509_req.c +++ b/src/lib/libcrypto/x509/x509_req.c | |||
| @@ -1,4 +1,4 @@ | |||
| 1 | /* $OpenBSD: x509_req.c,v 1.25 2021/11/03 12:53:25 schwarze Exp $ */ | 1 | /* $OpenBSD: x509_req.c,v 1.26 2021/11/03 13:27:28 schwarze Exp $ */ | 
| 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 2 | /* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com) | 
| 3 | * All rights reserved. | 3 | * All rights reserved. | 
| 4 | * | 4 | * | 
| @@ -212,24 +212,20 @@ X509_REQ_get_extensions(X509_REQ *req) | |||
| 212 | int idx, *pnid; | 212 | int idx, *pnid; | 
| 213 | const unsigned char *p; | 213 | const unsigned char *p; | 
| 214 | 214 | ||
| 215 | if ((req == NULL) || (req->req_info == NULL) || !ext_nids) | 215 | if (req == NULL || req->req_info == NULL || ext_nids == NULL) | 
| 216 | return (NULL); | 216 | return NULL; | 
| 217 | for (pnid = ext_nids; *pnid != NID_undef; pnid++) { | 217 | for (pnid = ext_nids; *pnid != NID_undef; pnid++) { | 
| 218 | idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); | 218 | idx = X509_REQ_get_attr_by_NID(req, *pnid, -1); | 
| 219 | if (idx == -1) | 219 | if (idx == -1) | 
| 220 | continue; | 220 | continue; | 
| 221 | attr = X509_REQ_get_attr(req, idx); | 221 | attr = X509_REQ_get_attr(req, idx); | 
| 222 | if (attr->single) | 222 | ext = X509_ATTRIBUTE_get0_type(attr, 0); | 
| 223 | ext = attr->value.single; | ||
| 224 | else if (sk_ASN1_TYPE_num(attr->value.set)) | ||
| 225 | ext = sk_ASN1_TYPE_value(attr->value.set, 0); | ||
| 226 | break; | 223 | break; | 
| 227 | } | 224 | } | 
| 228 | if (!ext || (ext->type != V_ASN1_SEQUENCE)) | 225 | if (ext == NULL || ext->type != V_ASN1_SEQUENCE) | 
| 229 | return NULL; | 226 | return NULL; | 
| 230 | p = ext->value.sequence->data; | 227 | p = ext->value.sequence->data; | 
| 231 | return (STACK_OF(X509_EXTENSION) *)ASN1_item_d2i(NULL, &p, | 228 | return d2i_X509_EXTENSIONS(NULL, &p, ext->value.sequence->length); | 
| 232 | ext->value.sequence->length, &X509_EXTENSIONS_it); | ||
| 233 | } | 229 | } | 
| 234 | 230 | ||
| 235 | /* | 231 | /* | 
