!= NULL
&& !add1_extension(&exts, NID_subject_alt_name, crit, default_sans))
goto err;
- if (ctx->reqExtensions != NULL /* augment/override existing ones */
+ if (sk_X509_EXTENSION_num(ctx->reqExtensions) > 0 /* augment/override existing ones */
&& X509v3_add_extensions(&exts, ctx->reqExtensions) == NULL)
goto err;
if (sk_GENERAL_NAME_num(ctx->subjectAltNames) > 0
return NULL;
}
-STACK_OF(X509_EXTENSION)
- *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
- const STACK_OF(X509_EXTENSION) *exts)
+/* This returns NULL also in non-error case *target == NULL && sk_X509_EXTENSION_num(exts) <= 0 */
+STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
+ const STACK_OF(X509_EXTENSION) *exts)
{
int i;
X509v3_get_ext_by_NID() returns the extension index or negative values if an
error occurs.
-X509v3_add_ext() and X509v3_add_extensions()
-return a STACK of extensions or NULL on error.
+X509v3_add_ext() returns a STACK of extensions or NULL on error.
+
+X509v3_add_extensions() returns a STACK of extensions
+or NULL on error or if I<*target> is NULL and I<exts> is NULL or an empty list.
X509_add_ext() returns 1 on success and 0 on error.
X509_EXTENSION *X509v3_delete_ext(STACK_OF(X509_EXTENSION) *x, int loc);
STACK_OF(X509_EXTENSION) *X509v3_add_ext(STACK_OF(X509_EXTENSION) **x,
X509_EXTENSION *ex, int loc);
-STACK_OF(X509_EXTENSION)
- *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
- const STACK_OF(X509_EXTENSION) *exts);
+STACK_OF(X509_EXTENSION) *X509v3_add_extensions(STACK_OF(X509_EXTENSION) **target,
+ const STACK_OF(X509_EXTENSION) *exts);
int X509_get_ext_count(const X509 *x);
int X509_get_ext_by_NID(const X509 *x, int nid, int lastpos);