Sorry if I sound too obvious.
Actually I think you need to allocate space for the
buffer, try with
unsigned char buf[4096] or something.
I am sure you have tried it ...
regards,
Girish
--- vipin rathor <[EMAIL PROTECTED]> wrote:
>
> hi all,
> i need to fetch the thumbprint of the X509
> cert. and for this i'm using X509_digest(). but it
> is throwing a segmentation fault. any idea how to
> fix this.....
> this is the code i'm using...
>
> void print_thubprint(X509 *cert)
> {
> const EVP_MD *md=NULL;
> unsigned char *buf=NULL;
> unsigned int len=0;
>
> //md=EVP_get_digestbyname("SHA1");
> /////////////////or
> //md=EVP_sha1();
> //both did not help....
>
> return=X509_digest(cert,md,buf,&len); //throws
> SIGSEGV
> ....
> //code to access buf [ ]
> ....
> }
>
> and the gdb output at this line shows:
> "Program received signal SIGSEGV, segmentation
> fault
> 0x402215ed in SHA1_Final() from
> /usr/lib/libcrypto.so.0.9.7"
>
> .........do i need to call
> EVP_init(),update(),final() explicitly???
>
> Thanks in advance,
> -vipin
>
>
> ---------------------------------
> Yahoo! Mail
> Bring photos to life! New PhotoMail makes sharing a
> breeze.
__________________________________________________
Do You Yahoo!?
Tired of spam? Yahoo! Mail has the best spam protection around
http://mail.yahoo.com
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List [email protected]
Automated List Manager [EMAIL PROTECTED]