I need to have OpenSSL use our own malloc/free. At first I thought I
would replace or redefine all Malloc's and Free's and similar items to
use our routines. If performance became an issue I would later prune
back to only where needed for absolute thread safety.
Our environment on mainframe does not support pthreads. In making
OpenSSL threadsafe between MVS tasks we wanted to handle all memory
allocations ourselves.
I *thought* all I had to do was change crypto/crypto.h like
#if defined(OURSTUFF)
#define Malloc OurMalloc
#define Realloc OurRealloc
#define FreeFunc OurFree
#define Free(addr) OurFree(addr)
#define Malloc_locked OurMalloc
#define Free_locked(addr) OurFree(addr)
#else
#define Malloc malloc
#define Realloc realloc
#define FreeFunc free
#define Free(addr) free(addr)
#define Malloc_locked malloc
#define Free_locked(addr) free(addr)
#endif /* OURSTUFF */
Unfortunately we crashed in a few places like pem_lib.c on a:
Free(b);
where b was allocated earlier in pem_lib.c via a call to
BIG_MEM_new(...).
I haven't located where BIG_MEM_new is defined or proto'd or
whatever. Not yet anyway.
Does anyone have a list of the places where changes are necessary? Is
it documented somewhere that I have missed?
Thanks muchly in advance! - Jim
--
Jim Keohane
Brigadier Consultant
LockStar, Inc.
1200 Wall Street West
Lyndhurst, NJ 07071
Tel: (201) 508-3231
Fax: (201) 508-3201
http://www.lockstar.com
"Anyone who considers protocol unimportant has never dealt with a cat"
-L.Long
______________________________________________________________________
OpenSSL Project http://www.openssl.org
Development Mailing List [EMAIL PROTECTED]
Automated List Manager [EMAIL PROTECTED]