While each attribute must contain at least one extension, it is not
required that a CSR have attributes at all. Instead of signalling an
error by returning NULL if no extensions are found, return an empty
stack of extensions.
Via OpenSSL
1f02ca2d
ok jsing
-/* $OpenBSD: x509_req.c,v 1.28 2022/01/22 00:34:48 inoguchi Exp $ */
+/* $OpenBSD: x509_req.c,v 1.29 2022/08/18 16:26:33 tb Exp $ */
/* Copyright (C) 1995-1998 Eric Young (eay@cryptsoft.com)
* All rights reserved.
*
ext = X509_ATTRIBUTE_get0_type(attr, 0);
break;
}
- if (ext == NULL || ext->type != V_ASN1_SEQUENCE)
+ if (ext == NULL)
+ return sk_X509_EXTENSION_new_null();
+ if (ext->type != V_ASN1_SEQUENCE)
return NULL;
p = ext->value.sequence->data;
return d2i_X509_EXTENSIONS(NULL, &p, ext->value.sequence->length);