summaryrefslogtreecommitdiffstats
path: root/crypto/mem_dbg.c
AgeCommit message (Collapse)Author
2015-01-22Run util/openssl-format-source -v -c .Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22crypto/mem_dbg.c: make it indent-friendly.Andy Polyakov
Reviewed-by: Tim Hudson <tjh@openssl.org>
2015-01-22Additional comment changes for reformat of 1.0.0Matt Caswell
Reviewed-by: Tim Hudson <tjh@openssl.org>
2009-04-16PR: 1894Dr. Stephen Henson
Submitted by: Ger Hobbelt <ger@hobbelt.com> Approved by: steve@openssl.org Fix various typos and stuff.
2009-01-11Add CRYPTO_MDEBUG_ABORT to abort() is there are any memory leaks. This willDr. Stephen Henson
cause "make test" failures and make resource leaks more obvious.
2008-11-12Revert the size_t modifications from HEAD that had led to moreGeoff Thorpe
knock-on work than expected - they've been extracted into a patch series that can be completed elsewhere, or in a different branch, before merging back to HEAD.
2008-11-01size_tification.Ben Laurie
2008-08-06Remove the dual-callback scheme for numeric and pointer thread IDs,Geoff Thorpe
deprecate the original (numeric-only) scheme, and replace with the CRYPTO_THREADID object. This hides the platform-specifics and should reduce the possibility for programming errors (where failing to explicitly check both thread ID forms could create subtle, platform-specific bugs). Thanks to Bodo, for invaluable review and feedback.
2008-07-17mem_dbg.c: avoid compiler warnings.Andy Polyakov
PR: 1693 Submitted by: Stefan Neis
2008-07-04Avoid warnings with -pedantic, specifically:Dr. Stephen Henson
Conversion between void * and function pointer. Value computed not used. Signed/unsigned argument.
2008-07-03Revert my earlier CRYPTO_THREADID commit, I will commit a reworkedGeoff Thorpe
version some time soon.
2008-05-26LHASH revamp. make depend.Ben Laurie
2008-03-28There was a need to support thread ID types that couldn't be reliably castGeoff Thorpe
to 'unsigned long' (ie. odd platforms/compilers), so a pointer-typed version was added but it required portable code to check *both* modes to determine equality. This commit maintains the availability of both thread ID types, but deprecates the type-specific accessor APIs that invoke the callbacks - instead a single type-independent API is used. This simplifies software that calls into this interface, and should also make it less error-prone - as forgetting to call and compare *both* thread ID accessors could have led to hard-to-debug/infrequent bugs (that might only affect certain platforms or thread implementations). As the CHANGES note says, there were corresponding deprecations and replacements in the thread-related functions for BN_BLINDING and ERR too.
2006-06-23New functions CRYPTO_set_idptr_callback(),Bodo Möller
CRYPTO_get_idptr_callback(), CRYPTO_thread_idptr() for a 'void *' type thread ID, since the 'unsigned long' type of the existing thread ID does not always work well.
2005-07-05Pull up Win64 support from 0.9.8.Andy Polyakov
2005-05-17Move cryptlib.h prior bio.h. Actually it makes sense to include cryptlib.hAndy Polyakov
first everywhere in crypto and skip stdio.h and string.h [because it includes them].
2003-12-27Use BUF_strlcpy() instead of strcpy().Richard Levitte
Use BUF_strlcat() instead of strcat(). Use BIO_snprintf() instead of sprintf(). In some cases, keep better track of buffer lengths. This is part of a large change submitted by Markus Friedl <markus@openbsd.org>
2002-11-18fix memory leak in memory debuggin code ...Bodo Möller
Submitted by: Nils Larsch
2002-11-13Security fixes brought forward from 0.9.7.Ben Laurie
2001-08-28Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn'tGeoff Thorpe
leave memory debugging turned off. [Spotted by Götz Babin-Ebell]
2001-08-27Make sure "CRYPTO_mem_leaks_fp" doesn't itself create a reportable memoryGeoff Thorpe
leak.
2001-07-08Correct const-ness.Ben Laurie
2001-02-22One indirection level too little compared to theRichard Levitte
pre-CRYPTO_MEM_LEAK_CB time.
2001-02-19Make all configuration macros available for application by makingRichard Levitte
sure they are available in opensslconf.h, by giving them names starting with "OPENSSL_" to avoid conflicts with other packages and by making sure e_os2.h will cover all platform-specific cases together with opensslconf.h. I've checked fairly well that nothing breaks with this (apart from external software that will adapt if they have used something like NO_KRB5), but I can't guarantee it completely, so a review of this change would be a good thing.
2001-02-19Memory leak detection bugfixes for multi-threading.Bodo Möller
2001-01-09Get rid of the function pointer casting in the debugging memory code dueGeoff Thorpe
to LHASH usage. NB: The callback type used as been suctioned off into crypto.h as CRYPTO_MEM_LEAK_CB to improve clarity.
2000-12-15Locking issues.Bodo Möller
2000-12-13Constification of the data of a hash table. This means the callbackRichard Levitte
functions need to be constified, and therefore meant a number of easy changes a little everywhere. Now, if someone could explain to me why OBJ_dup() cheats...
2000-12-08Next step in tidying up the LHASH code.Geoff Thorpe
DECLARE/IMPLEMENT macros now exist to create type (and prototype) safe wrapper functions that avoid the use of function pointer casting yet retain type-safety for type-specific callbacks. However, most of the usage within OpenSSL itself doesn't really require the extra function because the hash and compare callbacks are internal functions declared only for use by the hash table. So this change catches all those cases and reimplements the functions using the base-level LHASH prototypes and does per-variable casting inside those functions to convert to the appropriate item type. The exception so far is in ssl_lib.c where the hash and compare callbacks are not static - they're exposed in ssl.h so their prototypes should not be changed. In this last case, the IMPLEMENT_LHASH_*** macros have been left intact.
2000-12-04Make the remaining LHASH macro changes. This should leave no remainingGeoff Thorpe
cases of function pointer casting in lh_new() calls - and leave only the lh_doall and lh_doall_arg cases to be finished.
2000-12-01First step in tidying up the LHASH code. The callback prototypes (andGeoff Thorpe
casts) used in the lhash code are about as horrible and evil as they can be. For starters, the callback prototypes contain empty parameter lists. Yuck. This first change defines clearer prototypes - including "typedef"'d function pointer types to use as "hash" and "compare" callbacks, as well as the callbacks passed to the lh_doall and lh_doall_arg iteration functions. Now at least more explicit (and clear) casting is required in all of the dependant code - and that should be included in this commit. The next step will be to hunt down and obliterate some of the function pointer casting being used when it's not necessary - a particularly evil variant exists in the implementation of lh_doall.
2000-11-29use standard CUlf Möller
2000-11-12Enhance granularity on what I want to debug for the moment by changingRichard Levitte
LEVITTE_DEBUG to LEVITTE_DEBUG_MEM.
2000-06-01There have been a number of complaints from a number of sources that namesRichard Levitte
like Malloc, Realloc and especially Free conflict with already existing names on some operating systems or other packages. That is reason enough to change the names of the OpenSSL memory allocation macros to something that has a better chance of being unique, like prepending them with OPENSSL_. This change includes all the name changes needed throughout all C files.
2000-05-02In Message-ID: <003201bfb332$14a07520$0801a8c0@janm.transactionsite.com>,Richard Levitte
"Jan Mikkelsen" <janm@transactionsite.com> correctly states that the OpenSSL header files have #include's and extern "C"'s in an incorrect order. Thusly fixed. Also, make the memory debugging routines defined and declared with prototypes, and use void* instead of char* for memory blobs. And last of all, redo the ugly callback construct for elegance and better definition (with prototypes).
2000-03-18Eliminate memory leaks in mem_dbg.c.Bodo Möller
2000-02-11Make gcc 2.95.2 happy again, even under ``-Wall -Wshadow -Wpointer-arith ↵Ralf S. Engelschall
-Wcast-align -Wmissing-prototypes -Wmissing-declarations -Wnested-externs -Winline''.
2000-01-30Source code cleanups: Use void * rather than char * in lhash,Ulf Möller
eliminate some of the -Wcast-qual warnings (debug-ben-strict target)
2000-01-22Document the DH library, and make some minor changes along the way.Ulf Möller
2000-01-18Compaq C 6.2 for VMS will complain when we want to convertRichard Levitte
non-function pointers to function pointers and vice versa. The current solution is to have unions that describe the conversion we want to do, and gives us the ability to extract the type of data we want. The current solution is a quick fix, and can probably be made in a more general or elegant way.
2000-01-14Typo...Richard Levitte
2000-01-14Avoid some warnings, and run "make update".Bodo Möller
1999-12-18RenameBodo Möller
CRYPTO_add_info => CRYPTO_push_info CRYPTO_remove_info => CRYPTO_pop_info in the hope that these names are more descriptive; and "make update".
1999-12-18fix typos and other little errors ...Bodo Möller
1999-12-18- Don't assume that int and size_t have the same representationBodo Möller
(and that malloc can be called with an int argument). - Use proper prototypes (with argument list) for various function pointers, avoid casts (however there are still many such cases left in these files). - Avoid collissions in app_info_cmp if sizeof int != sizeof long. - Use CRYPTO_LOCK_MALLOC in mem_dbg.c.
1999-12-18 - Made sure some changed behavior is documented in CHANGES.Richard Levitte
- Moved the handling of compile-time defaults from crypto.h to mem_dbg.c, since it doesn't make sense for the library users to try to affect this without recompiling libcrypto. - Made sure V_CRYPTO_MDEBUG_TIME and V_CRYPTO_MDEBUG_THREAD had clear and constant definitions. - Aesthetic correction.
1999-12-17Clear out license confusion.Richard Levitte
1999-12-17Rebuild of the OpenSSL memory allocation and deallocation routines.Richard Levitte
With this change, the following is provided and present at all times (meaning CRYPTO_MDEBUG is no longer required to get this functionality): - hooks to provide your own allocation and deallocation routines. They have to have the same interface as malloc(), realloc() and free(). They are registered by calling CRYPTO_set_mem_functions() with the function pointers. - hooks to provide your own memory debugging routines. The have to have the same interface as as the CRYPTO_dbg_*() routines. They are registered by calling CRYPTO_set_mem_debug_functions() with the function pointers. I moved everything that was already built into OpenSSL and did memory debugging to a separate file (mem_dbg.c), to make it clear what is what. With this, the relevance of the CRYPTO_MDEBUG has changed. The only thing in crypto/crypto.h that it affects is the definition of the MemCheck_start and MemCheck_stop macros.