allocate a new attributes entry in X509_REQ_add_extensions()
if it's NULL (in case of a malformed pkcs10 request) PR: 1347 Submitted by: Remo Inverardi <invi@your.toilet.ch>
This commit is contained in:
parent
b0eedd77f6
commit
0f997d0dc3
@ -242,6 +242,11 @@ int X509_REQ_add_extensions_nid(X509_REQ *req, STACK_OF(X509_EXTENSION) *exts,
|
|||||||
at = NULL;
|
at = NULL;
|
||||||
attr->single = 0;
|
attr->single = 0;
|
||||||
attr->object = OBJ_nid2obj(nid);
|
attr->object = OBJ_nid2obj(nid);
|
||||||
|
if (!req->req_info->attributes)
|
||||||
|
{
|
||||||
|
if (!(req->req_info->attributes = sk_X509_ATTRIBUTE_new_null()))
|
||||||
|
goto err;
|
||||||
|
}
|
||||||
if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err;
|
if(!sk_X509_ATTRIBUTE_push(req->req_info->attributes, attr)) goto err;
|
||||||
return 1;
|
return 1;
|
||||||
err:
|
err:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user