On Wed, Jun 15, 2011, Thomas Jarosch wrote:

> Hello,
> 
> the X509 request API of openssl 0.9.8r features
> a function to get a stack of X509 extensions:
> 
> STACK_OF(X509_EXTENSION) *X509_REQ_get_extensions(X509_REQ *req);
> 
> 
> Is there something similar like X509_get_extensions()?
> 
> Right now I access the extensions "directly" like this
> (as seen in crypto/asn1/t_x509.c):
> 
>     X509_CINF *ci = x->cert_info;
>     if (ci && ci->extensions)
>     {
>         X509_REQ_add_extensions(x_req, ci->extensions);
>     }
> 
> 
> Is there a recommended way / API safe way to do this?
> 

There isn't a function to get all extensions. You could copy the extensions
one at a time into a STACK_OF(X509_EXTENSION) using the X509 APIs and then
pass the duplicates stack to X509_REQ_add_extensions().

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [email protected]
Automated List Manager                           [email protected]

Reply via email to