openssl/crypto
Geoff Thorpe 3a0799977b First step in fixing "ex_data" support. Warning: big commit log ...
Currently, this change merely addresses where ex_data indexes are stored
and managed, and thus fixes the thread-safety issues that existed at that
level. "Class" code (eg. RSA, DSA, etc) no longer store their own STACKS
and per-class index counters - all such data is stored inside ex_data.c. So
rather than passing both STACK+counter to index-management ex_data
functions, a 'class_index' is instead passed to indicate the class (eg.
CRYPTO_EX_INDEX_RSA). New classes can be dynamically registered on-the-fly
and this is also thread-safe inside ex_data.c (though whether the caller
manages the return value in a thread-safe way is not addressed).

This does not change the "get/set" functions on individual "ex_data"
structures, and so thread-safety at that level isn't (yet) assured.
Likewise, the method of getting and storing per-class indexes has not
changed, so locking may still be required at the "caller" end but is
nonetheless thread-safe inside "ex_data"'s internal implementation.
Typically this occurs when code implements a new method of some kind and
stores its own per-class index in a global variable without locking the
setting and usage of that variable. If the code in question is likely to be
used in multiple threads, locking the setting and use of that index is
still up to the code in question. Possible fixes to this are being
sketched, but definitely require more major changes to the API itself than
this change undertakes.

The underlying implementation in ex_data.c has also been modularised so
that alternative "ex_data" implementations (that control all access to
state) can be plugged in. Eg. a loaded module can have its implementation
set to that of the application loaded it - the result being that
thread-safety and consistency of "ex_data" classes and indexes can be
maintained in the same place rather than the loaded module using its own
copy of ex_data support code and state.

Due to the centralisation of "state" with this change, cleanup of all
"ex_data" state can now be performed properly. Previously all allocation of
ex_data state was guaranteed to leak - and MemCheck_off() had been used to
avoid it flagging up the memory debugging. A new function has been added to
perfrom all this cleanup, CRYPTO_cleanup_all_ex_data(). The "openssl"
command(s) have been changed to use this cleanup, as have the relevant test
programs. External application code may want to do so too - failure to
cleanup will not induce more memory leaking than was the case before, but
the memory debugging is not tricked into hiding it any more so it may
"appear" where it previously did not.
2001-09-01 19:56:46 +00:00
..
asn1 gcc can't spot that 'derlst' is not used uninitialised, so appease it. 2001-08-26 21:04:21 +00:00
bf make update 2001-07-31 17:07:24 +00:00
bio Bugfixes provided by "Stephen Hinton" <shinton@netopia.com>. 2001-08-16 15:28:00 +00:00
bn make update 2001-07-31 17:07:24 +00:00
buffer make update 2001-07-31 17:07:24 +00:00
cast make update 2001-07-31 17:07:24 +00:00
comp Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
conf make update 2001-07-31 17:07:24 +00:00
des Add first cut symmetric crypto support. 2001-08-18 10:22:54 +00:00
dh Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise, 2001-08-25 17:24:21 +00:00
dsa Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise, 2001-08-25 17:24:21 +00:00
dso make update 2001-07-31 17:07:24 +00:00
ec make update 2001-07-31 17:07:24 +00:00
engine Fix SSL memory leak. 2001-08-28 13:45:41 +00:00
err This changes the "ERR" code to have all access to state (a hash table of 2001-08-25 17:51:59 +00:00
evp Only OPENSSL_free() non-NULL pointers. 2001-09-01 18:37:17 +00:00
hmac Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
idea make update 2001-07-31 17:07:24 +00:00
krb5 Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
lhash make update 2001-07-31 17:07:24 +00:00
md2 make update 2001-07-31 17:07:24 +00:00
md4 make update 2001-07-31 17:07:24 +00:00
md5 make update 2001-07-31 17:07:24 +00:00
mdc2 make update 2001-07-31 17:07:24 +00:00
objects Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
ocsp Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
pem Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
perlasm Accept digits in symbol names. Spotted by Brian Havard <brianh@kheldar.apana.org.au> 2001-06-04 16:34:31 +00:00
pkcs7 Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
pkcs12 Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
rand Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
rc2 make update 2001-07-31 17:07:24 +00:00
rc4 make update 2001-07-31 17:07:24 +00:00
rc5 make update 2001-07-31 17:07:24 +00:00
rijndael make update 2001-07-31 17:07:24 +00:00
ripemd make update 2001-07-31 17:07:24 +00:00
rsa Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise, 2001-08-25 17:24:21 +00:00
sha make update 2001-07-31 17:07:24 +00:00
stack Add first cut symmetric crypto support. 2001-08-18 10:22:54 +00:00
threads Use new-style system-id macros everywhere possible. I hope I haven't 2001-02-20 08:13:47 +00:00
txt_db make update 2001-07-31 17:07:24 +00:00
ui The indexes returned by ***_get_ex_new_index() functions are used when 2001-08-12 16:52:00 +00:00
x509 Add first cut symmetric crypto support. 2001-08-18 10:22:54 +00:00
x509v3 Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
.cvsignore Always use buildinf.h, which now includes the mk1mfinf.h data. 1999-07-29 12:57:23 +00:00
cpt_err.c First step in fixing "ex_data" support. Warning: big commit log ... 2001-09-01 19:56:46 +00:00
cryptlib.c First step in fixing "ex_data" support. Warning: big commit log ... 2001-09-01 19:56:46 +00:00
cryptlib.h e_os.h does not belong with the exported headers. Do not put it there 2001-02-22 14:45:02 +00:00
crypto-lib.com Addapt VMS script to the latest changes in the makefiles. 2001-07-27 07:47:51 +00:00
crypto.h First step in fixing "ex_data" support. Warning: big commit log ... 2001-09-01 19:56:46 +00:00
cversion.c Add SSLEAY_DIR argument code for SSLeay_version. 2001-01-10 15:15:36 +00:00
ebcdic.c DEC C on VMS is pedantic by definition. 2001-02-20 13:24:23 +00:00
ebcdic.h EBCDIC support. 2000-02-01 02:21:16 +00:00
ex_data.c First step in fixing "ex_data" support. Warning: big commit log ... 2001-09-01 19:56:46 +00:00
install.com ui was forgotten when installing libcrypto and it's headers. 2001-05-14 12:22:27 +00:00
Makefile.ssl Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
md32_common.h Make EVP_Digest*() routines return a value. 2001-03-08 14:04:22 +00:00
mem.c No functional change, but slightly improved code clarity. 2001-01-10 19:26:34 +00:00
mem_dbg.c Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn't 2001-08-28 15:54:57 +00:00
o_time.c Make sure memcpy() gets properly declared by including string.h. 2001-08-03 10:54:00 +00:00
o_time.h Use one address consistently. 2001-07-05 10:20:07 +00:00
opensslconf.h.in Spelling corrected. 2001-03-02 10:57:54 +00:00
opensslv.h Apply the Tru64 patch from Tim Mooney <mooney@dogbert.cc.ndsu.NoDak.edu> 2001-08-10 15:26:21 +00:00
symhacks.h Make more short aliases for symbols that are longer than 31 2001-05-14 11:58:08 +00:00
tmdiff.c Code for better build under Darwin (MacOS X). 2001-03-07 10:04:00 +00:00
tmdiff.h Remove NOPROTO definitions and error code comments. 1999-04-26 16:43:10 +00:00
types.h Start to reduce some of the header bloat. 2001-08-05 18:02:16 +00:00
uid.c User OPENSSL_UNISTD instead of <unistd.h>. 2001-04-26 08:26:18 +00:00