Have CRYPTO_MDEBUG_TIME automatically set CRYPTO_MDEBUG,
authorBodo Möller <bodo@openssl.org>
Mon, 19 Jul 1999 09:25:35 +0000 (09:25 +0000)
committerBodo Möller <bodo@openssl.org>
Mon, 19 Jul 1999 09:25:35 +0000 (09:25 +0000)
and make it the default for some debugging configurations.

CHANGES
Configure
TABLE
crypto/crypto.h
crypto/des/Makefile.ssl
crypto/mem.c

diff --git a/CHANGES b/CHANGES
index 8e613aa3dc096ccf1a090cb230f4c1d812213359..bc321389f4565b2382adbb6f9d45e33f20286c36 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -54,7 +54,8 @@
      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),
index 221ea7cc11d36917d13d02199e76aff5a828e6f2..d2938c9124a92f7677ce620b9e36a3119d10f1e2 100755 (executable)
--- 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 e0933ea73182024d50cca7e51ecf56a2635dd1b1..dd8651b6ba053051cbf7de1429d2652c0af9934f 100644 (file)
--- 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
index 1b927e189da85c0cfc1f144e7f4f0ef86a5ff63d..fe8292fcbee1e0bd3128ef7f3aac77dc1e6445e9 100644 (file)
@@ -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)
index bedd865d9592ecfa2029f86de5a23ce831661261..09fdd07305e5ed72b96542cf531e3b7d02159dde 100644 (file)
@@ -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
index 9693842ec338076e9c10f45bed0504c9c30c8c55..77df8062986bece0afe788c55fc847b7d6956044 100644 (file)
@@ -58,6 +58,7 @@
 
 #include <stdio.h>
 #include <stdlib.h>
+#include <openssl/crypto.h>
 #ifdef CRYPTO_MDEBUG_TIME
 # include <time.h>     
 #endif