Commit graph

1976 commits

Author SHA1 Message Date
Geoff Thorpe
db744f8950 Fix a typo in the preprocessor logic in eng_list.c that had left RSA, DSA,
and DH all conditional upon OPENSSL_NO_RSA.
2001-09-14 18:23:31 +00:00
Geoff Thorpe
e059b19ddb Add a SHA1 test to evptests.txt - only the MD5 hash algorithm was being
tested previously.
2001-09-14 18:21:36 +00:00
Geoff Thorpe
997a54c981 'evp_test' needs to initialise and cleanup EVP_CIPHER_CTX structures. Also,
fix a typo and add cleanup operations. This also switches on memory leak
checking (which is how the rest was found).
2001-09-14 18:20:44 +00:00
Bodo Möller
4e1b0d8904 avoid "statement not reached" warning 2001-09-13 13:02:59 +00:00
Geoff Thorpe
1a1422643b ENGINE uses a very opaque design, so we can predeclare the structure type
in "types.h" so that very few headers will need to include engine.h,
generally only C files using API functions will need it (reducing
the header dependencies quite a lot).
2001-09-12 02:34:20 +00:00
Geoff Thorpe
409960491d ENGINE files were renamed, and error strings are now in eng_err.c 2001-09-12 01:54:17 +00:00
Dr. Stephen Henson
96bd6f730a Add certificate and request demos.
Fix X509V3 macro so they compile.
2001-09-12 00:19:20 +00:00
Geoff Thorpe
51ac0cfe44 make update 2001-09-10 21:18:11 +00:00
Geoff Thorpe
1023cfe70d enginetest needs 'memset' defined. 2001-09-10 21:02:06 +00:00
Ulf Möller
8e0a2d8461 missed one file 2001-09-10 20:16:31 +00:00
Bodo Möller
9f29ec4721 fix memory leak (I think) 2001-09-10 18:50:09 +00:00
Bodo Möller
b9a20b5057 remove an old comment 2001-09-10 18:49:25 +00:00
Bodo Möller
8573fa1806 avoid warning ('const' discarded) 2001-09-10 17:46:54 +00:00
Bodo Möller
5a85385387 typo 2001-09-10 16:57:06 +00:00
Bodo Möller
5e54b4f364 Get rid of hazardous EVP_DigestInit_dbg/EVP_DigestInit case
distinction (which does not work well because if CRYPTO_MDEBUG is
defined at library compile time, it is not necessarily defined at
application compile time; and memory debugging now can be reconfigured
at run-time anyway).  To get the intended semantics, we could just use
the EVP_DigestInit_dbg unconditionally (which uses the caller's
__FILE__ and __LINE__ for memory leak debugging), but this would make
memory debugging inconsistent.  Instead, callers can use
CRYPTO_push_info() to track down memory leaks.
2001-09-10 15:00:30 +00:00
Bodo Möller
5ba372b17c Get rid of hazardous EVP_DigestInit_dbg/EVP_DigestInit case
distinction (which does not work well because if CRYPTO_MDEBUG is
defined at library compile time, it is not necessarily defined at
application compile time; and memory debugging now can be reconfigured
at run-time anyway).  To get the intended semantics, we could just use
the EVP_DigestInit_dbg unconditionally (which uses the caller's
__FILE__ and __LINE__ for memory leak debugging), but this would make
memory debugging inconsistent.  Instead, callers can use
CRYPTO_push_info() to track down memory leaks.

Also fix indentation, and add OpenSSL copyright.
2001-09-10 14:59:17 +00:00
Bodo Möller
f9b0f47c0c copyright 2001-09-10 14:51:19 +00:00
Bodo Möller
4deeadf7dc Delete pointless casts 2001-09-10 14:10:10 +00:00
Bodo Möller
384eff877c Fix apps/openssl.c and ssl/ssltest.c so that they use
CRYPTO_set_mem_debug_options() instead of CRYPTO_dbg_set_options(),
which is the default implementation of the former and should usually
not be directly used by applications (at least if we assume that the
options accepted by the default implementation will also be meaningful
to any other implementations).

Also fix apps/openssl.c and ssl/ssltest such that environment variable
setting 'OPENSSL_DEBUG_MEMORY=off' actively disables the compiled-in
library defaults (i.e. such that CRYPTO_MDEBUG is ignored in this
case).
2001-09-10 09:50:30 +00:00
Dr. Stephen Henson
68dbba9817 Replace old (and invalid) copyright notice. 2001-09-08 12:15:09 +00:00
Bodo Möller
ea7150b070 The various hash #includes in rand_lcl.h *are* needed despite
<openssl/evp.h> is now used (MD_DIGEST_LENGTH definitions!).
No need to include such headers directly in md_rand.c.
2001-09-07 23:55:15 +00:00
Ben Laurie
e8330cf5ac Add a cleanup function for MDs. 2001-09-07 12:03:24 +00:00
Ben Laurie
f1047cebea Remove duplication. 2001-09-07 11:44:59 +00:00
Ben Laurie
da8a2e6f90 Now need sha.h for some reason. 2001-09-07 11:44:17 +00:00
Ben Laurie
546ec5a9b3 Redo type-safety fix. 2001-09-07 11:43:30 +00:00
Ulf Möller
14cfde9c83 make engine file names unique in 8.3 2001-09-07 04:14:48 +00:00
Ulf Möller
ce9eab79a7 unused function 2001-09-06 17:02:33 +00:00
Ulf Möller
e9e202cfa8 include the proper header file 2001-09-06 16:25:34 +00:00
Ulf Möller
d83ae69455 double definition 2001-09-06 16:24:29 +00:00
Bodo Möller
619b2c03dc Avoid strdup.
(Some platforms need _XOPEN_SOURCE and _XOPEN_SOURCE_EXTENDED to get
the declaration, but on other platforms _XOPEN_SOURCE disables
the strdup declaration in <string.h>.)
2001-09-06 13:09:00 +00:00
Bodo Möller
78f7923580 Totally get rid of CRYPTO_LOCK_ERR_HASH.
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.
2001-09-06 12:37:36 +00:00
Bodo Möller
a9ed4da8eb improve OAEP check 2001-09-06 10:42:56 +00:00
Bodo Möller
e1a4814cd4 fix formatting so that the file can be view with any tab-width 2001-09-06 09:30:16 +00:00
Geoff Thorpe
1a7691c059 This adds "destroy" handlers to the existing ENGINEs that load their own
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.
2001-09-05 19:00:33 +00:00
Geoff Thorpe
f524ddbe04 ENGINE's init() and finish() handler functions are used when the ENGINE is
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.
2001-09-05 18:32:23 +00:00
Geoff Thorpe
e815d3015e Change DH_up() -> DH_up_ref() 2001-09-05 17:02:35 +00:00
Geoff Thorpe
dc2a33d680 "DH_up" had been changed to "DH_up_ref" in libeay.num but the function
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.
2001-09-05 16:54:32 +00:00
Bodo Möller
7ba45bf133 Solaris <string.h> does not declare 'strdup' if _XOPEN_SOURCE is
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.)
2001-09-05 14:40:05 +00:00
Ulf Möller
d98a4b7366 bug fix: bn_sqr_recursive output is twice its input size. 2001-09-05 04:43:43 +00:00
Ulf Möller
9d07fd03e3 Use GCC 2.95/3.0 optimization 2001-09-05 02:18:40 +00:00
Ulf Möller
5b46eee0f5 strsep implementation to allow the file to compile on non-BSD systems
Submitted by: "Brian Havard" <brianh@kheldar.apana.org.au>
2001-09-04 22:19:06 +00:00
Geoff Thorpe
e5e6a94fbf Make the 'dynamic' ENGINE bundle up the loading application/library's
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.
2001-09-04 21:25:17 +00:00
Geoff Thorpe
d9ff889073 Add a "_up" -> "_up_ref" change to libeay.num that was missing from the
recent changes. Also, do the same change to the DSO_up() function.
2001-09-04 20:40:41 +00:00
Bodo Möller
e4decc418a typo 2001-09-04 11:57:17 +00:00
Bodo Möller
cf5bfbfc21 Now that we have ERR_unload_strings(), ERR_load_ERR_strings() must
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.
2001-09-04 11:49:14 +00:00
Bodo Möller
567fef894e changing something requires a write lock, not a read lock 2001-09-04 11:15:55 +00:00
Bodo Möller
435037d4e4 OpenSSL copyright notices ... 2001-09-04 11:02:23 +00:00
Bodo Möller
c5de8996cc delete redundant ERR_load_CRYPTO_strings() prototype 2001-09-04 10:45:01 +00:00
Geoff Thorpe
2dc5383a20 This changes the existing hardware ENGINE implementations to dynamically
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.
2001-09-03 21:33:00 +00:00
Geoff Thorpe
9391f97715 This change adds a new ENGINE called "dynamic" that allows new ENGINE
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.
2001-09-03 19:15:29 +00:00