and make it the default for some debugging configurations.
this bug.
[Steve Henson, reported by Doug Erickson <Doug.Erickson@Part.NET>]
- *) Memory leak checking had some problems. The interface is as follows:
+ *) Memory leak checking (-DCRYPTO_MDEBUG) had some problems.
+ The interface is as follows:
Applications can use
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON) aka MemCheck_start(),
CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF) aka MemCheck_stop();
Some inconsistent states that previously were possible (and were
even the default) are now avoided.
+
+ -DCRYPTO_MDEBUG_TIME is new and additionally stores the current time
+ with each memory chunk allocated; this is occasionally more helpful
+ than just having a counter.
[Bodo Moeller]
*) Introduce "mode" for SSL structures (with defaults in SSL_CTX),
"debug-ben-debug", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -g3 -O2 -pedantic -Wall -Wshadow -Werror -pipe::(unknown):::::",
"debug-ben-strict", "gcc:-DBN_DEBUG -DREF_CHECK -DCRYPTO_MDEBUG -DCONST_STRICT -O2 -Wall -Wshadow -Werror -Wpointer-arith -Wcast-qual -Wwrite-strings -pipe::(unknown):::::",
"debug-rse","cc:-DTERMIOS -DL_ENDIAN -pipe -O -g -ggdb3 -Wall::(unknown)::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
-"debug-bodo", "gcc:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG -DCRYPTO_MDEBUG_TIME -g -m486 -Wall::-D_REENTRANT::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
+"debug-bodo", "gcc:-DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_TIME -g -m486 -Wall::-D_REENTRANT::BN_LLONG $x86_gcc_des $x86_gcc_opts:$x86_elf_asm",
"dist", "cc:-O::(unknown):::::",
# Basic configs that should work on any box
"solaris-sparc-gcc","gcc:-O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8.o::",
"solaris-usparc-gcc","gcc:-O3 -fomit-frame-pointer -mcpu=ultrasparc -Wall -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus-gcc.o:::asm/md5-sparcv8plus.o:",
"solaris-usparc-oldgcc","gcc:-O3 -fomit-frame-pointer -mv8 -Wall -DB_ENDIAN -DULTRASPARC::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus-gcc.o:::asm/md5-sparcv8plus.o:",
-"debug-solaris-sparc-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",
-"debug-solaris-usparc-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus-gcc.o::",
+"debug-solaris-sparc-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG_TIME -O -g -mv8 -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:::",
+"debug-solaris-usparc-gcc","gcc:-DREF_CHECK -DCRYPTO_MDEBUG_TIME -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_UNROLL BF_PTR:asm/sparcv8plus-gcc.o::",
# DO NOT use /xO[34] on sparc with SC3.0. It is broken, and will not pass the tests
"solaris-sparc-sc3","cc:-fast -O -Xa -DB_ENDIAN::-D_REENTRANT:-lsocket -lnsl:BN_LLONG RC4_CHAR DES_PTR DES_UNROLL BF_PTR:::",
*** debug-bodo
$cc = gcc
-$cflags = -DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG -g -m486 -Wall
+$cflags = -DBIO_PAIR_DEBUG -DL_ENDIAN -DREF_CHECK -DCRYPTO_MDEBUG_TIME -g -m486 -Wall
$unistd =
$thread_cflag = -D_REENTRANT
$lflags =
*** debug-solaris-sparc-gcc
$cc = gcc
-$cflags = -DREF_CHECK -DCRYPTO_MDEBUG -O -g -mv8 -Wall -DB_ENDIAN
+$cflags = -DREF_CHECK -DCRYPTO_MDEBUG_TIME -O -g -mv8 -Wall -DB_ENDIAN
$unistd =
$thread_cflag = -D_REENTRANT
$lflags = -lsocket -lnsl
*** debug-solaris-usparc-gcc
$cc = gcc
-$cflags = -DREF_CHECK -DCRYPTO_MDEBUG -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN
+$cflags = -DREF_CHECK -DCRYPTO_MDEBUG_TIME -O -g -mcpu=ultrasparc -Wall -DB_ENDIAN
$unistd =
$thread_cflag = -D_REENTRANT
$lflags = -lsocket -lnsl
(char *(*)())realloc,\
(void (*)())free)
+#ifdef CRYPTO_MDEBUG_TIME
+# ifndef CRYPTO_MDEBUG /* avoid duplicate #define */
+# define CRYPTO_MDEBUG
+# endif
+#endif
+
#ifdef CRYPTO_MDEBUG
#define MemCheck_start() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_ON)
#define MemCheck_stop() CRYPTO_mem_ctrl(CRYPTO_MEM_CHECK_OFF)
enc_writ.o: ../../include/openssl/crypto.h ../../include/openssl/des.h
enc_writ.o: ../../include/openssl/e_os.h ../../include/openssl/e_os2.h
enc_writ.o: ../../include/openssl/err.h ../../include/openssl/opensslconf.h
-enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/stack.h
-enc_writ.o: ../cryptlib.h des_locl.h
+enc_writ.o: ../../include/openssl/opensslv.h ../../include/openssl/rand.h
+enc_writ.o: ../../include/openssl/stack.h ../cryptlib.h des_locl.h
fcrypt.o: ../../include/openssl/des.h ../../include/openssl/des.h
fcrypt.o: ../../include/openssl/e_os2.h ../../include/openssl/e_os2.h
fcrypt.o: ../../include/openssl/opensslconf.h
#include <stdio.h>
#include <stdlib.h>
+#include <openssl/crypto.h>
#ifdef CRYPTO_MDEBUG_TIME
# include <time.h>
#endif