> From: owner-openssl-us...@openssl.org On Behalf Of > Radha krishna Meduri -X (radmedur - HCL at Cisco) > Sent: Friday, 08 January, 2010 01:13
> #include "openssl/ssl.h" > #include "stdio.h" > Aside: it's conventional and sometimes better to use < > format for system/std headers like stdio.h. > FILE* m_pfCRLFile=0; > const char* m_pszURL; > > const char* m_pszCRLFile = "test_pem.crl"; > > printf("systhesized file name= %s\n", m_pszCRLFile); > Aside: IAYM 'synthesized' but I don't see how. Maybe this is leftover from other more complicated code. > m_pfCRLFile = fopen( m_pszCRLFile , "wb"); > > if( !m_pfCRLFile ) > { > printf("Unable to open file %s for writing", m_pszCRLFile); > exit(0); > } > You open for writing, which empties the file, but then ... > X509_CRL *pCRL=0, *pTempCRL = 0; > > pCRL = d2i_X509_CRL_fp( m_pfCRLFile, &pTempCRL ); > .. try to read. That can't work. Also: you don't need to use both the &pTempCRL argument and the return value pCRL. Either one is sufficient. > if( !pCRL ) > { > printf("Unable to read using d2i_X509_CRL_fp\n"); > pCRL = PEM_read_X509_CRL(m_pfCRLFile, &pTempCRL, NULL, 0); Ditto, and ditto. > } > > if( !pCRL ) > { > printf("Unable to read CRL file\n" ); > exit(0); > } ______________________________________________________________________ OpenSSL Project http://www.openssl.org User Support Mailing List openssl-users@openssl.org Automated List Manager majord...@openssl.org