Can you try adding "OpenSSL_add_all_algorithms();" the line before calling " 
PKCS7_dataInit".

-Madhu

-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Luis Alberto 
Pérez Paz
Sent: Tuesday, May 10, 2005 9:12 PM
To: openssl-users@openssl.org
Subject: Re: PROBLEMS with PKCS7 type signedAndEnveloped

Thanks Tan Eng for your answer and advice,
I tried it however the code has the same behavior ->crash in the
PKCS7_dataInit<-
I'll continue looking for.

Luis A Perez


On 5/9/05, Tan Eng Ten <[EMAIL PROTECTED]> wrote:
> Before PKCS7_dataInit(), try adding:
>
> PKCS7_content_new(thePKCS7, NID_pkcs7_data)
>
> U might also want to explore PKCS7_set_detached() to see if this applies
> for you.
>
> -ET Tan
>
> Luis Alberto Pérez Paz wrote:
> > Hi everybody,
> > I need your help, I'm trying to make a PKCS7 signedAndEnveloped.
> > I have read some examples about it, but I dont know where's my error.
> >
> > there's a synthesis of my code:
> >
> > /*********************************/
> > .....
> > .......
> >
> > PKCS7 *thePKCS7 = NULL;
> >
> >    if( (thePKCS7 = PKCS7_new()) == NULL )               return false;
> >
> > PKCS7_set_type(thePKCS7, NID_pkcs7_signedAndEnveloped);
> >
> >    if( PKCS7_add_signature(thePKCS7, certificate, priv_key,
> > EVP_sha1()) == NULL )     return false;
> >
> >       PKCS7_add_certificate(thePKCS7, certificate);
> >
> >  if (!PKCS7_add_recipient(thePKCS7,certificate_recipient))   return false;
> >
> > PKCS7_set_cipher(thePKCS7, EVP_des_ede3_cbc());
> >
> >   BIO *thePKCS7DataBio = NULL;
> >   if ((thePKCS7DataBio=PKCS7_dataInit(thePKCS7, NULL )) == NULL)
> >       return false;
> >
> > if( BIO_write(thePKCS7DataBio, buffer,   sizeof (buffer) ) <= 0 )
> > return false;
> >
> >  BIO_flush(thePKCS7DataBio);
> >
> >  if( !PKCS7_dataFinal(thePKCS7, thePKCS7DataBio) ) return false;
> >
> > ....
> > ......
> >
> > /*********************************/
> >
> > The code compile however when I try to run it, the program and my
> > terminal (windows XP) crash in the PKCS7_dataInit
> >
> >  << thePKCS7DataBio=PKCS7_dataInit(thePKCS7, NULL ) >>
> >
> >
> >
> >
> > Any ideas / suggestions?
> >
> >
> > thanks in advance,
> >
> > Luis A Perez
> >
> >
> ______________________________________________________________________
> OpenSSL Project                                 http://www.openssl.org
> User Support Mailing List                    openssl-users@openssl.org
> Automated List Manager                           [EMAIL PROTECTED]
>


--
paz, amor y comprensión
        (1967-1994)
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

************************************************************************

This Email Message is for the sole use of the intended recipient(s) and May 
contain CONFIDENTIAL and PRIVILEGED information.
LG Soft India will not be responisible for any viruses or defects or any 
forwarded attachements emanating either from within
LG Soft India or outside. Any unauthorised review , use, disclosure or 
distribution is prohibited. If you are not intentded
recipient, please contact the sender by reply email and destroy all copies of 
the original message.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to