[EMAIL PROTECTED] - Mon Jul 21 15:55:36 2003]:

> OS: solaris64-sparcv9-gcc
> OpenSSL: 0.9.7
> 
> Hello,
> 
> I'm getting a
> "segmentation fault", when calling PKCS12_parse in the following way:
> ...
>  X509 *tmpCert;
>  EVP_PKEY *tmpKey;
> PKCS12* pkcs12;
> ...
>  if
> ((pkcs12=d2i_PKCS12_bio("test.p12",NULL))==NULL) {
>      return
> ERR__D2I_PKCS12_BIO;
>  }
>  if
> ((PKCS12_parse(pkcs12,"123456",&tmpKey,&tmpCert,NULL))==0) {
> return ERR_PKCS12_PARSE;
>  }
> ...
> 
> 
> The "segmentation fault"
> appears in function EVP_CipherInit_ex at this Code-Line:
> ctx-
> >cipher_data=OPENSSL_malloc(ctx->cipher->ctx_size);
> 
> On 32-Bit
> Solaris, Cygwin, Unix-NCR there is no problem. 
> 
> I've found a
> workaround to avoid the segmentation fault: Add in function parse_bag
> (p12_kiss.c) at the beginning this funny line:
> void*
> tmp=(void*)malloc(0);
> 
> Seems to be a serious memory problem?!

I suggest you try the latest 0.9.7 snapshots first.

Are you really calling:

d2i_PKCS12_bio("test.p12",NULL)??

or is there some code to open a file BIO with test.p12 and you pass that
to d2i_PKCS12_bio?

I don't have access to Solaris 64 so I can't try it myself.

However if you could a stack trace when it crashes, also the value of
ctx->ciper->ctx_size that would help.

Steve.
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
Development Mailing List                       [EMAIL PROTECTED]
Automated List Manager                           [EMAIL PROTECTED]

Reply via email to