[openssl-users] Extract content of DER-encoded package by OID

Dr. Stephen Henson steve at openssl.org
Thu Jul 20 23:07:05 UTC 2017


On Thu, Jul 20, 2017, Justin Mogannam wrote:

> Thanks for the tips thus far. One of the last issues I'm having is actually
> declaring a CMS_ContentInfo structure. I just declare :
> 
> CMS_ContentInfo cms;
> 
> Amd gcc tells me "error: storage size of 'cms' isn't known". This goes back
> to my question 1 of the previous email: is there a particular function call
> to use to construct a CMS_ContentInfo structure? Thanks! 
> 

In common with many structures CMS_ContentInfo is opaque so you can only
declare pointers to the structure not the structure itself.  The
d2i_CMS_ContentInfo() function will return a pointer to a CMS_ContentInfo
structure containing the contents of the parsed DER buffer. You can then use
that pointer in other CMS utility functions.

Steve.
--
Dr Stephen N. Henson. OpenSSL project core developer.
Commercial tech support now available see: http://www.openssl.org


More information about the openssl-users mailing list