From: Bodo Möller Date: Mon, 19 Jul 1999 09:25:35 +0000 (+0000) Subject: Have CRYPTO_MDEBUG_TIME automatically set CRYPTO_MDEBUG, X-Git-Tag: OpenSSL_0_9_4~91 X-Git-Url: https://git.librecmc.org/?a=commitdiff_plain;h=458cddc1042eb91c5bb1e2bffd8fcfe5ee960d4d;p=oweals%2Fopenssl.git Have CRYPTO_MDEBUG_TIME automatically set CRYPTO_MDEBUG, and make it the default for some debugging configurations. --- diff --git a/CHANGES b/CHANGES index 8e613aa3dc..bc321389f4 100644 --- a/CHANGES +++ b/CHANGES @@ -54,7 +54,8 @@ this bug. [Steve Henson, reported by Doug Erickson ] - *) 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(); @@ -66,6 +67,10 @@ 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), diff --git a/Configure b/Configure index 221ea7cc11..d2938c9124 100755 --- a/Configure +++ b/Configure @@ -97,7 +97,7 @@ my %table=( "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 @@ -109,8 +109,8 @@ my %table=( "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:::", diff --git a/TABLE b/TABLE index e0933ea731..dd8651b6ba 100644 --- a/TABLE +++ b/TABLE @@ -631,7 +631,7 @@ $rc5_obj = *** 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 = @@ -699,7 +699,7 @@ $rc5_obj = asm/r586-elf.o *** 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 @@ -716,7 +716,7 @@ $rc5_obj = *** 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 diff --git a/crypto/crypto.h b/crypto/crypto.h index 1b927e189d..fe8292fcbe 100644 --- a/crypto/crypto.h +++ b/crypto/crypto.h @@ -200,6 +200,12 @@ typedef struct crypto_ex_data_func_st (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) diff --git a/crypto/des/Makefile.ssl b/crypto/des/Makefile.ssl index bedd865d95..09fdd07305 100644 --- a/crypto/des/Makefile.ssl +++ b/crypto/des/Makefile.ssl @@ -168,8 +168,8 @@ enc_writ.o: ../../include/openssl/bio.h ../../include/openssl/buffer.h 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 diff --git a/crypto/mem.c b/crypto/mem.c index 9693842ec3..77df806298 100644 --- a/crypto/mem.c +++ b/crypto/mem.c @@ -58,6 +58,7 @@ #include #include +#include #ifdef CRYPTO_MDEBUG_TIME # include #endif