aboutsummaryrefslogtreecommitdiffstats
path: root/crypto
Commit message (Collapse)AuthorAgeFilesLines
* Totally get rid of CRYPTO_LOCK_ERR_HASH.Bodo Möller2001-09-063-60/+72
| | | | | | | | | In err.c, flags int_error_hash_set and int_thread_hash_set appear superfluous since we can just as well initialize int_error_hash and int_thread_hash to NULL. Change some of the err.c formatting to conform with the rest of OpenSSL.
* improve OAEP checkBodo Möller2001-09-061-12/+27
|
* fix formatting so that the file can be view with any tab-widthBodo Möller2001-09-061-129/+129
|
* This adds "destroy" handlers to the existing ENGINEs that load their ownGeoff Thorpe2001-09-055-6/+97
| | | | | | error strings - the destroy handler functions unload the error strings so any pending error state referring to them will not attempt to reference them after the ENGINE has been destroyed.
* ENGINE's init() and finish() handler functions are used when the ENGINE isGeoff Thorpe2001-09-053-0/+18
| | | | | | | | | | being enabled or disabled (respectively) for operation. Additionally, each ENGINE has a constructor function where it can do more 'structural' level intialisations such as loading error strings, creating "ex_data" indices, etc. This change introduces a handler function that gives an ENGINE a corresponding opportunity to cleanup when the ENGINE is being destroyed. It also adds the "get/set" API functions that control this "destroy" handler function in an ENGINE.
* Change DH_up() -> DH_up_ref()Geoff Thorpe2001-09-051-2/+2
|
* "DH_up" had been changed to "DH_up_ref" in libeay.num but the functionGeoff Thorpe2001-09-052-2/+2
| | | | | | declaration and implementation had not. So a recent update recreated the original definition in libeay.num ... this corrects it and changes the "dh" code to the "up_ref" variant.
* Solaris <string.h> does not declare 'strdup' if _XOPEN_SOURCE isBodo Möller2001-09-051-1/+1
| | | | | | | | | defined. (Preprocessor symbols such as _POSIX_C_SOURCE or _XOPEN_SOURCE are supposed to disable anything not allowed by the respective specification; I'm not sure why 'strdup' would be considered an outlaw though.)
* bug fix: bn_sqr_recursive output is twice its input size.Ulf Möller2001-09-051-1/+1
|
* Use GCC 2.95/3.0 optimizationUlf Möller2001-09-051-1/+2
|
* strsep implementation to allow the file to compile on non-BSD systemsUlf Möller2001-09-041-2/+33
| | | | Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
* Make the 'dynamic' ENGINE bundle up the loading application/library'sGeoff Thorpe2001-09-042-8/+40
| | | | | | | locking callbacks to pass to the loaded library (in addition to the existing mem, ex_data, and err callbacks). Also change the default implementation of the "bind_engine" function to apply those callbacks, ie. the IMPLEMENT_DYNAMIC_BIND_FN macro.
* Add a "_up" -> "_up_ref" change to libeay.num that was missing from theGeoff Thorpe2001-09-043-5/+5
| | | | recent changes. Also, do the same change to the DSO_up() function.
* typoBodo Möller2001-09-041-1/+1
|
* Now that we have ERR_unload_strings(), ERR_load_ERR_strings() mustBodo Möller2001-09-041-22/+24
| | | | | | | always load its strings because they might have been unloaded since the 'init' flag was deleted. But build_SYS_str_reasons() can use an 'init' flag.
* changing something requires a write lock, not a read lockBodo Möller2001-09-041-7/+15
|
* OpenSSL copyright notices ...Bodo Möller2001-09-042-1/+54
|
* delete redundant ERR_load_CRYPTO_strings() prototypeBodo Möller2001-09-041-1/+0
|
* This changes the existing hardware ENGINE implementations to dynamicallyGeoff Thorpe2001-09-0310-357/+719
| | | | | | | | | | | | | | | | | | declare their own error strings so that they can be more easily compiled as external shared-libraries if desired. Also, each implementation has been given canonical "dynamic" support at the base of each file and is only built if the ENGINE_DYNAMIC_SUPPORT symbol is defined. Also, use "void" prototypes rather than empty prototypes in engine_int.h. This does not yet; (i) remove error strings when unloading, (ii) remove the redundant ENGINE_R_*** codes (though ENGINE_F_*** codes have gone), or (iii) provide any instructions on how to build shared-library ENGINEs or use them. All are on their way.
* This change adds a new ENGINE called "dynamic" that allows new ENGINEGeoff Thorpe2001-09-036-6/+531
| | | | | | | | | | | | | | | | | | | | | | | | implementations to be loaded from self-contained shared-libraries. It also provides (in engine.h) definitions and macros to help implement a self-contained ENGINE. Version control is handled in a way whereby the loader or loadee can veto the load depending on any objections it has with each other's declared interface level. The way this is currently implemented assumes a veto will only take place when one side notices the other's interface level is too *old*. If the other side is newer, it should be assumed the newer version knows better whether to veto the load or not. Version checking (like other "dynamic" settings) can be controlled using the "dynamic" ENGINE's control commands. Also, the semantics for the loading allow a shared-library ENGINE implementation to handle differing interface levels on the fly (eg. loading secondary shared-libraries depending on the versions required). Code will be added soon to the existing ENGINEs to illustrate how they can be built as external libraries rather than building statically into libcrypto. NB: Applications wanting to support "dynamic"-loadable ENGINEs will need to add support for ENGINE "control commands". See apps/engine.c for an example of this, and use "apps/openssl engine -vvvv" to test or experiment.
* Add a new ERR function, "ERR_unload_strings", to complement the existingGeoff Thorpe2001-09-032-0/+27
| | | | "ERR_load_strings" function.
* Correct a typo.Geoff Thorpe2001-09-031-1/+1
|
* Rename recently introduced functions for improved code clarity:Bodo Möller2001-09-035-10/+10
| | | | [DR]SA_up => [DR]SA_up_ref
* Use uniformly chosen witnesses for Miller-Rabin testBodo Möller2001-09-033-8/+74
| | | | (by using new BN_pseudo_rand_range function)
* rearrange #includes because trying to include <crypto/cryptodev.h>Bodo Möller2001-09-031-7/+8
| | | | is a bad idea if OPENSSL_OPENBSD_DEV_CRYPTO is not defined
* Convert "max" to "mx" for variable names (brought to my attention by SteveGeoff Thorpe2001-09-021-25/+26
| | | | | | Henson). Also, reverse a previous change that used an implicit function pointer cast rather than an explicit data pointer cast in the STACK cleanup code.
* Make MD functions take EVP_MD_CTX * instead of void *, add copy() function.Ben Laurie2001-09-0216-118/+317
|
* Make the necessary changes to work with the recent "ex_data" overhaul.Geoff Thorpe2001-09-0118-123/+114
| | | | | | | | | | | See the commit log message for that for more information. NB: X509_STORE_CTX's use of "ex_data" support was actually misimplemented (initialisation by "memset" won't/can't/doesn't work). This fixes that but requires that X509_STORE_CTX_init() be able to handle errors - so its prototype has been changed to return 'int' rather than 'void'. All uses of that function throughout the source code have been tracked down and adjusted.
* First step in fixing "ex_data" support. Warning: big commit log ...Geoff Thorpe2001-09-014-119/+504
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Only OPENSSL_free() non-NULL pointers.Geoff Thorpe2001-09-011-4/+6
|
* undo, didn't workUlf Möller2001-09-011-34/+3
|
* *** empty log message ***Ulf Möller2001-09-011-1/+1
|
* strsep implementation to allow the file to compile on non-BSD systemsUlf Möller2001-09-011-2/+33
| | | | Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
* Ensure that failure to create the BIO in 'CRYPTO_mem_leaks_fp' doesn'tGeoff Thorpe2001-08-281-2/+2
| | | | | leave memory debugging turned off. [Spotted by Götz Babin-Ebell]
* Fix SSL memory leak.Ben Laurie2001-08-283-2/+26
|
* Make sure "CRYPTO_mem_leaks_fp" doesn't itself create a reportable memoryGeoff Thorpe2001-08-271-0/+5
| | | | leak.
* "make update"Geoff Thorpe2001-08-261-18/+0
|
* gcc can't spot that 'derlst' is not used uninitialised, so appease it.Geoff Thorpe2001-08-261-1/+1
|
* Test digests.Ben Laurie2001-08-263-21/+100
|
* Add digests.Ben Laurie2001-08-261-12/+144
|
* Tidy up some code formatting.Geoff Thorpe2001-08-251-18/+18
|
* This changes the "ERR" code to have all access to state (a hash table ofGeoff Thorpe2001-08-252-137/+285
| | | | | | | | | | | | | | | | | error strings and a hash table storing per-thread error state) go via an ERR_FNS function table. The first time an ERR operation occurs, the implementation that will be used (from then on) is set to the internal "defaults" implementation if it has not already been set. The actual LHASH tables are only accessed by this implementation. This is primarily for modules that can be loaded at run-time and bound into an application (or a shared-library version of OpenSSL). If the module has its own statically-linked copy of OpenSSL code - this mechanism allows it to *not* create and use ERR information in its own linked "ERR" code, but instead to use and interact with the state stored in the loader (application or shared library). The loader calls ERR_get_implementation() and the return value is what the module should use when calling its own copy of ERR_set_implementation().
* Changes crypto/evp/ and ssl/ code from directly incrementing referenceGeoff Thorpe2001-08-251-6/+9
| | | | | counts in DH, DSA, and RSA structures. Instead they use the new "***_up()" functions that handle this.
* Give DH, DSA, and RSA functions to "up" their reference counts. Otherwise,Geoff Thorpe2001-08-256-1/+54
| | | | | | | dependant code has to directly increment the "references" value of each such structure using the corresponding lock. Apart from code duplication, this provided no "REF_CHECK/REF_PRINT" checking and violated encapsulation.
* Add #ifdefs to some devcrypto codeDr. Stephen Henson2001-08-231-0/+3
|
* More tests.Ben Laurie2001-08-221-0/+9
|
* Add RC4 support to OpenBSD.Ben Laurie2001-08-184-28/+60
|
* Add AES tests.Ben Laurie2001-08-182-4/+28
|
* Add EVP test program.Ben Laurie2001-08-188-15/+306
|
* Add first cut symmetric crypto support.Ben Laurie2001-08-1813-10/+289
|