On Wed, Oct 01, 2014, Pedro Lamaro wrote: > Hello, fellows. > > I am implementing a new streamer for CMS_SignedData with CMS_sign. > Because I need to adapt a certain input and output interface, I chose > to use BIO pairs with BIO_new_CMS. I read from my original input > stream, write into the CMS filter, read from the pair and write to the > original output stream. > > My program successfuly produces a SignedData structure in the end, but > the actual data is embedded. I have passed (CMS_BINARY | CMS_DETACHED > | CMS_STREAM) as flags to the initial call to CMS_sign but still the > SignedData is not being produced detached. > > Am I missing something? Is there another way I can achieve the same thing? > > The code that follows is a true fragment from my original program. >
This may work: cms = CMS_sign(...args...); /* Make sure you set CMS_STREAM */ BIO *cmsbio = CMS_dataInit(cms, NULL); ..write any content you want signing to cmsbio multiple calls allowed... CMS_dataFinal(cms, cmsbio); /* cms should now contain valid signedData */ 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 User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org