Hi Shane

Thankyou. This is working perfectly but why my code was failing?

I used  d2i_X509_CRL_fp api instead of d2i_X509_CRL_bio. Any idea what
is difference? Am I doing any wrong in my program?

Thanks
Radhakrishna.

-----Original Message-----
From: owner-openssl-us...@openssl.org
[mailto:owner-openssl-us...@openssl.org] On Behalf Of Shane Steidley
Sent: Saturday, January 09, 2010 2:32 AM
To: openssl-users@openssl.org
Subject: RE: Unable to load CRL

This is straight out of the openssl verify program, and seems to be
exactly what you need:

static X509_CRL *load_crl(char *infile, int format) { X509_CRL *x=NULL;
BIO *in=NULL;

in=BIO_new(BIO_s_file());
if (in == NULL)
{
ERR_print_errors(bio_err);
goto end;
}

if (infile == NULL)
BIO_set_fp(in,stdin,BIO_NOCLOSE);
else
{
if (BIO_read_filename(in,infile) <= 0)
{
perror(infile);
goto end;
}
}
if (format == FORMAT_ASN1)
x=d2i_X509_CRL_bio(in,NULL);
else if (format == FORMAT_PEM)
x=PEM_read_bio_X509_CRL(in,NULL,NULL,NULL);
else {
BIO_printf(bio_err,"bad input format specified for input crl\n"); goto
end; } if (x == NULL) { BIO_printf(bio_err,"unable to load CRL\n");
ERR_print_errors(bio_err); goto end; }

end:
BIO_free(in);
return(x);
}
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
______________________________________________________________________
OpenSSL Project                                 http://www.openssl.org
User Support Mailing List                    openssl-users@openssl.org
Automated List Manager                           majord...@openssl.org
          • Re: Una... Patrick Patterson
            • RE... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Patrick Patterson
              • ... Dr. Stephen Henson
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... Christian Hohnstaedt
              • ... Radha krishna Meduri -X (radmedur - HCL at Cisco)
              • ... sandeep kiran p
  • RE: Unable to load CRL Shane Steidley
    • RE: Unable to load ... Radha krishna Meduri -X (radmedur - HCL at Cisco)

Reply via email to