Andy Polyakov wrote:
We're using the binary distributions from Shining Light for Windows
compiling with Borland C++ Builder 6.0 , the source version from
OpenSSL.org for Linux. Linux works peachy.
... the applink bit (which is a pain) but eventually that all seems
sorted.
PEM_read_X509 still crashes.
...
So I have my own copy of "int file_gets(BIO *bp, char *buf, int size)"
and before I call PEM_read_X509 I say;
BIO_s_file()->bgets = file_gets;
and now instead of crashing, the certificate loads fine.
The only alteration is that now "file_gets" lives in the app instead
of the statically linked library.
My question is, is this part of some known issue that I've missed
finding the documentation for?
No, it's a bug: applink was not enganged for that particular call. See
http://cvs.openssl.org/chngview?cn=14467 for fix.
Or is this some sort of bizarre effect
of the Borland link/calling conventions?
But there is no guarantee that there no bizarre effects left. As far as
I understand above mentioned binary distribution is built with Visual C
and then Borland libs are obtained by format converting utility,
presumably coff2omf. A.
The Win32 OpenSSL Installation Project is built as follows:
Visual C++ 6 SP6 w/ MASM is used to build the core DLLs and the Visual
C++ libraries.
Borland's IMPLIB tool is used to create libraries from the DLLs for
Builder 4/5/6.
A combination of MinGW's dlltool and Borland's IMPDEF is used to create
the libraries for MinGW.
Several custom-built applications are used to tweak the headers
(#include files) a little so MinGW apps compile properly and the
included Perl binaries work as expected.
Then everything is packaged into a nice, neat installation using InnoSetup.
Most of this process is now automated, but it still takes a good couple
hours to build, package, test, and upload.
As to your specific problem, I haven't been following it up to this
point, but using FILE * from Builder inside OpenSSL is a great way to
crash the application. Since Visual C++ has its own definition of FILE
and Builder has its own definition, attempting to pass in a Builder FILE
to a VC++ FILE will cause a crash. OpenSSL provides a workaround by
using BIO's exclusively. Since I can't tell if you are using FILE *
anywhere in relation to OpenSSL, I figure the information can't hurt any.
Also, directly modifying a BIO is, IMO, a bad idea because the
underlying structure could change between versions of OpenSSL and the
Win32 OpenSSL Installation Project is designed to be easily swapped with
future versions by the user.
Just a couple pennies.
--
Thomas Hruska
Shining Light Productions
Home of BMP2AVI, Nuclear Vision, ProtoNova, and Win32 OpenSSL.
http://www.slproweb.com/
Ask me about discounts on any Shining Light Productions product!
______________________________________________________________________
OpenSSL Project http://www.openssl.org
User Support Mailing List openssl-users@openssl.org
Automated List Manager [EMAIL PROTECTED]