oweals/openssl.git
24 years agoAdded references to RFCs 1421 to 1424, that describe PEM.
Richard Levitte [Mon, 26 Jun 2000 16:12:01 +0000 (16:12 +0000)]
Added references to RFCs 1421 to 1424, that describe PEM.
Suggested by Randolph Bentson <bentson@grieg.holmsjoen.com>

24 years agoBSD-style MD5-based password algorithm in 'openssl passwd'.
Bodo Möller [Fri, 23 Jun 2000 18:00:16 +0000 (18:00 +0000)]
BSD-style MD5-based password algorithm in 'openssl passwd'.
(Still needs to be tested against the original using sample passwords
of different length.)

24 years agoSteve fixed up some strange errors introduced into dso_win32.c, and I'm
Geoff Thorpe [Fri, 23 Jun 2000 17:29:05 +0000 (17:29 +0000)]
Steve fixed up some strange errors introduced into dso_win32.c, and I'm
just converting some spaces to tabs from his fix. :-)

24 years agoActually comment out the parts of BN_MOD_MUL_WORD that I inteded to
Bodo Möller [Fri, 23 Jun 2000 08:10:28 +0000 (08:10 +0000)]
Actually comment out the parts of BN_MOD_MUL_WORD that I inteded to
comment out in the previous commit

24 years agoIn BN_mod_exp_mont_word, avoid one application of BN_MOD_MUL_WORD,
Bodo Möller [Fri, 23 Jun 2000 05:51:37 +0000 (05:51 +0000)]
In BN_mod_exp_mont_word, avoid one application of BN_MOD_MUL_WORD,
and for small 'a' also a couple of calls to
BN_mod_mul_montgomery(r, r, r, ...).

24 years agoMove add_oid_section to apps.c, so it can be shared by several
Richard Levitte [Thu, 22 Jun 2000 22:07:27 +0000 (22:07 +0000)]
Move add_oid_section to apps.c, so it can be shared by several
applications.  Also, have it and the certificate and key loading
functions take a BIO argument for error output.

24 years agoDocument the change in req.
Richard Levitte [Thu, 22 Jun 2000 21:17:46 +0000 (21:17 +0000)]
Document the change in req.

24 years agoChange req so the new parameter '-rand file' uses the given file in
Richard Levitte [Thu, 22 Jun 2000 21:16:01 +0000 (21:16 +0000)]
Change req so the new parameter '-rand file' uses the given file in
addition to the file given through the RANDFILE option or environment
variable.

24 years agoOn case-insensitive systems, the 'install' target gets matched against
Richard Levitte [Thu, 22 Jun 2000 18:02:23 +0000 (18:02 +0000)]
On case-insensitive systems, the 'install' target gets matched against
the 'INSTALL' file, which means that 9 times of 10, the BlowFish
headers won't get installed.  Avoid this in the same way it's done in
crypto/des/Makefile.ssl, where someone apparently has thought of this...

24 years agoMove the certificate and key loading functions to apps.c, so they can
Richard Levitte [Thu, 22 Jun 2000 17:42:50 +0000 (17:42 +0000)]
Move the certificate and key loading functions to apps.c, so they can
be shared by several applications.

24 years agoForgot the self-documentation within req.
Richard Levitte [Thu, 22 Jun 2000 09:59:21 +0000 (09:59 +0000)]
Forgot the self-documentation within req.

24 years agoDocument the change in req.
Richard Levitte [Thu, 22 Jun 2000 09:19:59 +0000 (09:19 +0000)]
Document the change in req.

24 years agoSmall change to accept the command line parameter '-rand file'. This
Richard Levitte [Thu, 22 Jun 2000 09:13:43 +0000 (09:13 +0000)]
Small change to accept the command line parameter '-rand file'.  This
parameter takes precedence over the RANDFILE option in the
configuration file.

24 years agoChange mkstack.pl so it now sorts each group
Dr. Stephen Henson [Thu, 22 Jun 2000 00:34:27 +0000 (00:34 +0000)]
Change mkstack.pl so it now sorts each group
into lexical order. Previously it depended on
the order of files in the directory.

This should now mean that all systems will
agree on the order of safestack.h and will
not change it needlessly and avoid massive
needless commits to safestack.h in future.

It wont however avoid this one :-(

24 years agouse faster version
Ulf Möller [Wed, 21 Jun 2000 21:20:46 +0000 (21:20 +0000)]
use faster version

24 years ago* This adds some checking to the 'dlfcn' DSO_METHOD that at least lets
Geoff Thorpe [Wed, 21 Jun 2000 14:12:25 +0000 (14:12 +0000)]
* This adds some checking to the 'dlfcn' DSO_METHOD that at least lets
  it cope with OpenBSD which doesn't understand "RTLD_NOW".
* Added the dso_scheme config string entry for OpenBSD-x86 to give it
  DSO support.
* 'make update' that has also absorbed some of Steve's mkstack changes
  for the ASN-related macros.

24 years agoFixes for Win32 build.
Dr. Stephen Henson [Wed, 21 Jun 2000 02:25:30 +0000 (02:25 +0000)]
Fixes for Win32 build.

This is mostly a work around for the old VC++ problem
that it treats func() as func(void).

Various prototypes had been added to 'compare' function
pointers that triggered this. This could be fixed by removing
the prototype, adding function pointer casts to every call or
changing the passed function to use the expected arguments.
I mostly did the latter.

The mkdef.pl script was modified to remove the typesafe
functions which no longer exist.

Oh and some functions called OPENSSL_freeLibrary() were
changed back to FreeLibrary(), wonder how that happened :-)

24 years agoHandle ASN1_SET_OF and PKCS12_STACK_OF using function
Dr. Stephen Henson [Tue, 20 Jun 2000 18:45:28 +0000 (18:45 +0000)]
Handle ASN1_SET_OF and PKCS12_STACK_OF using function
casts in the same way as STACK_OF.

24 years ago'make update'
Geoff Thorpe [Tue, 20 Jun 2000 14:06:06 +0000 (14:06 +0000)]
'make update'

24 years agoAvoid unnecessary links and incomplete program file in apps/.
Bodo Möller [Mon, 19 Jun 2000 17:38:22 +0000 (17:38 +0000)]
Avoid unnecessary links and incomplete program file in apps/.

24 years ago'make update'
Richard Levitte [Mon, 19 Jun 2000 16:51:41 +0000 (16:51 +0000)]
'make update'

24 years agoAdd the missing callback pointer handling functions.
Richard Levitte [Mon, 19 Jun 2000 16:38:27 +0000 (16:38 +0000)]
Add the missing callback pointer handling functions.
Also, make sure empty slots of the dynamic lock stack are used.
Actually, I'm not really sure this is the right thing to do, and may
remove it, with an endlessly growing stack as result...

24 years agoThe dynamic thread API changed, and so does the documentation.
Richard Levitte [Mon, 19 Jun 2000 15:28:36 +0000 (15:28 +0000)]
The dynamic thread API changed, and so does the documentation.

24 years agoAdd OPENSSL_free at the end of CRYPTO_destroy_dynlockid.
Bodo Möller [Mon, 19 Jun 2000 13:53:15 +0000 (13:53 +0000)]
Add OPENSSL_free at the end of CRYPTO_destroy_dynlockid.

24 years agoRedo the support for dynamic locks. First of all, it was terribly
Richard Levitte [Mon, 19 Jun 2000 13:38:09 +0000 (13:38 +0000)]
Redo the support for dynamic locks.  First of all, it was terribly
insecure, so a static lock is added to isolate the sensitive parts.
Also, to avoid one thread freeing a lock that is used by another, a
reference counter is added.

24 years agoWith the new stack hack macros, there's no need to shorten the names
Richard Levitte [Sun, 18 Jun 2000 16:07:41 +0000 (16:07 +0000)]
With the new stack hack macros, there's no need to shorten the names
any more.

24 years agoModifications for VMS.
Richard Levitte [Sun, 18 Jun 2000 16:06:44 +0000 (16:06 +0000)]
Modifications for VMS.

24 years agoAdd support for dynamically created and destroyed mutexes. This will
Richard Levitte [Sun, 18 Jun 2000 15:59:04 +0000 (15:59 +0000)]
Add support for dynamically created and destroyed mutexes.  This will
be needed in some ENGINE code, and might serve elsewhere as well.
Note that it's implemented in such a way that the locking itself is
done through the same CRYPTO_lock function as the static locks.

WARNING: This is currently experimental and untested code (it will get
tested soon, though :-)).

24 years agoFirst of all, with the current macros, we should never get any
Richard Levitte [Sun, 18 Jun 2000 14:06:40 +0000 (14:06 +0000)]
First of all, with the current macros, we should never get any
type-specific stack function.  Second, even when we don't build any of
those functions, DECLARE_STACK_OF lines should not find themselves
into $def.

24 years agoUsing speaking "variable" names in macros so that e.g. grepping for
Bodo Möller [Sat, 17 Jun 2000 23:41:44 +0000 (23:41 +0000)]
Using speaking "variable" names in macros so that e.g. grepping for
sk_whatever_insert and sk_whatever_set immediately reveals the subtle
difference in parameter order.

Change mkstack.pl so that safestack.h is not rewritten when
nothing has changed.

24 years agoSafe stack reorganisation in terms of function casts.
Dr. Stephen Henson [Fri, 16 Jun 2000 23:29:26 +0000 (23:29 +0000)]
Safe stack reorganisation in terms of function casts.

After some messing around this seems to work but needs
a few more tests. Working out the syntax for sk_set_cmp_func()
(cast it to a function that itself returns a function pointer)
was painful :-(

Needs some testing to see what other compilers think of this
syntax.

Also needs similar stuff for ASN1_SET_OF etc etc.

24 years agoChange to have a single library that works on both Win9x and WinNT.
Richard Levitte [Fri, 16 Jun 2000 15:25:41 +0000 (15:25 +0000)]
Change to have a single library that works on both Win9x and WinNT.
As far as I understand, it still needs to be compiled on NT...
Contributed by Arne Ansper <arne@ats.cyber.ee>

24 years agotypo
Bodo Möller [Fri, 16 Jun 2000 14:35:05 +0000 (14:35 +0000)]
typo

24 years agoIn EVP_BytesToKey, replace explicit "8" by "PKCS5_SALT_LEN".
Bodo Möller [Fri, 16 Jun 2000 14:29:51 +0000 (14:29 +0000)]
In EVP_BytesToKey, replace explicit "8" by "PKCS5_SALT_LEN".

24 years agoThere are compilers that complain if a variable has the same name as a
Bodo Möller [Fri, 16 Jun 2000 14:24:37 +0000 (14:24 +0000)]
There are compilers that complain if a variable has the same name as a
label. (Reported by Alexei Bakharevski.)

24 years agoCurrently the DSO_METHOD interface has one entry point to bind all
Geoff Thorpe [Fri, 16 Jun 2000 10:45:36 +0000 (10:45 +0000)]
Currently the DSO_METHOD interface has one entry point to bind all
"symbols" including functions (of all prototypes( and variables. Whilst
casting any function type to another violates ANSI C (I believe), it is
a necessary evil in shared-library APIs. However, it is quite
conceivable that functions in general and data symbols could very well
be represented differently to each other on some systems, as Bodo said;

> Since the function/object distinction is a lot more likely to be
> important on real-life platforms supporting DSO *and* it can be quite
> easily done *and* it will silence compilers that don't like
> assignments from void pointers to function pointer variables, why
> not do it?

I agree. So this change splits the "dso_bind" handler in DSO_METHOD
into "dso_bind_var" and "dso_bind_func". Similarly the exported
function DSO_bind() has been split in two. I've also put together
changes for the various DSO_METHOD implementations, but so far only
DSO_dlfcn() has been tested. BTW: The prototype for dso_bind had been
a bit strange so I've taken the opportunity to change its shape (in
both variations).

Also, the README has been updated - particularly with a note about
using customised native name-translation for shared libraries (and that
you can't do it yet).

24 years agoAdd support for the modified SGC key format used in IIS.
Dr. Stephen Henson [Thu, 15 Jun 2000 23:48:05 +0000 (23:48 +0000)]
Add support for the modified SGC key format used in IIS.

24 years agoThis seems to work better with enums...
Richard Levitte [Thu, 15 Jun 2000 20:57:25 +0000 (20:57 +0000)]
This seems to work better with enums...

24 years agoMake sure that bs is not getting free'd again.
Richard Levitte [Thu, 15 Jun 2000 11:10:15 +0000 (11:10 +0000)]
Make sure that bs is not getting free'd again.
Reported by Robert Eiglmaier <robert.eiglmaier@ixos.de>

24 years agoAdd info on what some other people are currently working on.
Richard Levitte [Wed, 14 Jun 2000 17:27:02 +0000 (17:27 +0000)]
Add info on what some other people are currently working on.

24 years agoReport "error" (usually just "File exists", which is harmless)
Bodo Möller [Wed, 14 Jun 2000 10:09:46 +0000 (10:09 +0000)]
Report "error" (usually just "File exists", which is harmless)
when symlink() fails.

24 years agoThis probably fixes a BN_rshift bug.
Bodo Möller [Tue, 13 Jun 2000 15:07:39 +0000 (15:07 +0000)]
This probably fixes a BN_rshift bug.

24 years agoUse BN_CTX_end when exiting early from BN_mod_exp_mont_word because
Bodo Möller [Tue, 13 Jun 2000 13:50:42 +0000 (13:50 +0000)]
Use BN_CTX_end when exiting early from BN_mod_exp_mont_word because
BN_mod_exp_atalla could be used.

24 years agoThe atalla functionality doesn't work with the "word" version of
Geoff Thorpe [Tue, 13 Jun 2000 13:18:51 +0000 (13:18 +0000)]
The atalla functionality doesn't work with the "word" version of
BN_mod_exp. Call the regular atalla mod_exp operation instead.

24 years agoEnable DSO support on alpha (OSF1), cc and gcc.
Geoff Thorpe [Tue, 13 Jun 2000 12:59:38 +0000 (12:59 +0000)]
Enable DSO support on alpha (OSF1), cc and gcc.

Also, "make update" has added some missing functions to libeay.num,
updated the TABLE for the alpha changes, and updated thousands of
dependancies that have changed from recent commits.

24 years agoprotoypes
Ulf Möller [Mon, 12 Jun 2000 19:45:38 +0000 (19:45 +0000)]
protoypes

24 years agotypo
Ulf Möller [Mon, 12 Jun 2000 18:50:59 +0000 (18:50 +0000)]
typo

24 years agoFix evp_locl.h macros.
Dr. Stephen Henson [Sun, 11 Jun 2000 15:43:17 +0000 (15:43 +0000)]
Fix evp_locl.h macros.

Documentation correction.

24 years agoMake EVP_SealInit() and EVP_OpenInit() check EVP_EncryptInit() and
Dr. Stephen Henson [Sun, 11 Jun 2000 12:27:58 +0000 (12:27 +0000)]
Make EVP_SealInit() and EVP_OpenInit() check EVP_EncryptInit() and
EVP_DecryptInit() return values.

Update docs.

24 years agoDocument EVP routines. Change EVP_SealInit() and EVP_OpenInit()
Dr. Stephen Henson [Sun, 11 Jun 2000 12:18:15 +0000 (12:18 +0000)]
Document EVP routines. Change EVP_SealInit() and EVP_OpenInit()
to support multiple calls.

New function to retrieve email address from certificates and
requests.

24 years agoIn longer tests with g=2, DH exchange does not become quite as fast
Bodo Möller [Sat, 10 Jun 2000 12:05:52 +0000 (12:05 +0000)]
In longer tests with g=2, DH exchange does not become quite as fast
as expected -- maybe it's the different processor, maybe my
previous timings were too inaccurate.

24 years agoBN_mod_exp_mont_word entry:
Bodo Möller [Sat, 10 Jun 2000 10:08:31 +0000 (10:08 +0000)]
BN_mod_exp_mont_word entry:
Don't give performance gain estimates that appear to be more precise
than they really are, especially when they are wrong
(2/(1/1.15 + 1) = ca. 1.0698).

24 years agoComment about bcopy on SunOS 4.x.
Bodo Möller [Fri, 9 Jun 2000 16:43:49 +0000 (16:43 +0000)]
Comment about bcopy on SunOS 4.x.

24 years agoUsing checks of the existence of HEADER_{foo}_H in other header files
Richard Levitte [Fri, 9 Jun 2000 10:41:35 +0000 (10:41 +0000)]
Using checks of the existence of HEADER_{foo}_H in other header files
was a really bad idea.  For example, the following:

#include <x509.h>
#include <bio.h>
#include <asn1.h>

would make sure that things like ASN1_UTCTIME_print() wasn't defined
unless you moved the inclusion of bio.h to above the inclusion of
x509.h.  The reason is that x509.h includes asn1.h, and the
declaration of ASN1_UTCTIME_print() depended on the definition of
HEADER_BIO_H.  That's what I call an obscure bug.

Instead, this change makes sure that whatever header files are needed
for the correct process of one header file are included automagically,
and that the definitions of, for example, BIO-related things are
dependent on the absence of the NO_{foo} macros.  This is also
consistent with the way parts of OpenSSL can be excluded at will.

24 years agoComment for increased code clarity.
Bodo Möller [Fri, 9 Jun 2000 09:11:30 +0000 (09:11 +0000)]
Comment for increased code clarity.

24 years agoAnother attempt to allow compiling on SunOS 4.*.
Bodo Möller [Thu, 8 Jun 2000 22:47:09 +0000 (22:47 +0000)]
Another attempt to allow compiling on SunOS 4.*.

24 years agoHarmonize indentation.
Bodo Möller [Thu, 8 Jun 2000 22:41:03 +0000 (22:41 +0000)]
Harmonize indentation.

24 years agoAccept -F4 option in lower case, which is what the usage information
Bodo Möller [Thu, 8 Jun 2000 22:40:09 +0000 (22:40 +0000)]
Accept -F4 option in lower case, which is what the usage information
says one should use.

24 years agoSlightly faster DSA verification (BN_mod_exp2_mont),
Bodo Möller [Thu, 8 Jun 2000 20:26:03 +0000 (20:26 +0000)]
Slightly faster DSA verification (BN_mod_exp2_mont),
marginally faster BN_mod_exp for 1024 bit exponents.

24 years agoAdd entry that Richard forgot.
Bodo Möller [Thu, 8 Jun 2000 15:01:14 +0000 (15:01 +0000)]
Add entry that Richard forgot.

24 years agoUse the equivalent of a sliding window (without precomputation
Bodo Möller [Thu, 8 Jun 2000 09:39:28 +0000 (09:39 +0000)]
Use the equivalent of a sliding window (without precomputation
because we're only handling words anyway) in BN_mod_exp_mont_word
making it a little faster for very small exponents,
and adjust the performance gain estimate in CHANGES according
to slightly more thorough measurements.
(15% faster than BN_mod_exp_mont for "large" base,
20% faster than BN_mod_exp_mont for small base.)

24 years agoSpeed up DH with small generator.
Bodo Möller [Wed, 7 Jun 2000 21:29:25 +0000 (21:29 +0000)]
Speed up DH with small generator.

24 years agoNo need to abort if c_rehash fails here (e.g. because Perl is not where
Bodo Möller [Wed, 7 Jun 2000 21:28:15 +0000 (21:28 +0000)]
No need to abort if c_rehash fails here (e.g. because Perl is not where
it is expected).

24 years agouse consistent indentation
Bodo Möller [Wed, 7 Jun 2000 19:43:44 +0000 (19:43 +0000)]
use consistent indentation

24 years agoOption "no-symlinks" to configure without creating the links (e.g.
Ulf Möller [Tue, 6 Jun 2000 20:52:42 +0000 (20:52 +0000)]
Option "no-symlinks" to configure without creating the links (e.g.
for use with makefile.one)

24 years agoCompaq C warns that "the expression 'p=scan_esc(p)' modifies the variable
Andy Polyakov [Tue, 6 Jun 2000 15:21:12 +0000 (15:21 +0000)]
Compaq C warns that "the expression 'p=scan_esc(p)' modifies the variable
'p' more than once without an intervening sequence point.  This behavior
is undefined." What it essentially complains about is 'p=p+=1'. Now it's
changed to 'p=p+1'...

24 years agoMT-support for IRIX 6.x and Alpha-Linux
Andy Polyakov [Tue, 6 Jun 2000 14:13:16 +0000 (14:13 +0000)]
MT-support for IRIX 6.x and Alpha-Linux

24 years agoIncreased consideration for stupid Linux users.
Ulf Möller [Tue, 6 Jun 2000 02:45:18 +0000 (02:45 +0000)]
Increased consideration for stupid Linux users.

24 years agoGCC 2.95.2 from IRIX 6.5 -mabi=64 compiler bug workaround:-(
Andy Polyakov [Mon, 5 Jun 2000 14:39:47 +0000 (14:39 +0000)]
GCC 2.95.2 from IRIX 6.5 -mabi=64 compiler bug workaround:-(

Submitted by:
Reviewed by:
PR:

24 years agoint may be smaller than 32 bits.
Bodo Möller [Mon, 5 Jun 2000 13:50:57 +0000 (13:50 +0000)]
int may be smaller than 32 bits.

24 years agoAccording to Gordon Atwood <gordon@cs.ualberta.ca>, GNU C on SunOS
Richard Levitte [Sun, 4 Jun 2000 07:17:28 +0000 (07:17 +0000)]
According to Gordon Atwood <gordon@cs.ualberta.ca>, GNU C on SunOS
4.1.4 uses libiberty to define strtoul and strerror.

24 years agoAccording to Gordon Atwood <gordon@cs.ualberta.ca>, stdlib.h is
Richard Levitte [Sun, 4 Jun 2000 07:12:20 +0000 (07:12 +0000)]
According to Gordon Atwood <gordon@cs.ualberta.ca>, stdlib.h is
needed, or size_t won't be defined on SunOS 4.1.4.

24 years agoTypo...
Richard Levitte [Sun, 4 Jun 2000 07:08:29 +0000 (07:08 +0000)]
Typo...

24 years agoCygWin32 support.
Ulf Möller [Sat, 3 Jun 2000 23:23:10 +0000 (23:23 +0000)]
CygWin32 support.

Submitted by: John Jarvie <jjarvie@newsguy.com>

24 years agoYet another bc FAQ.
Ulf Möller [Sat, 3 Jun 2000 23:21:43 +0000 (23:21 +0000)]
Yet another bc FAQ.

24 years agoEVP constification.
Ben Laurie [Sat, 3 Jun 2000 14:13:58 +0000 (14:13 +0000)]
EVP constification.

24 years agoThere have been a number of complaints from a number of sources that names
Richard Levitte [Thu, 1 Jun 2000 22:19:21 +0000 (22:19 +0000)]
There have been a number of complaints from a number of sources that names
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.

24 years agoUse NO_FP_API.
Ulf Möller [Thu, 1 Jun 2000 20:25:44 +0000 (20:25 +0000)]
Use NO_FP_API.

24 years agoDon't include <stdlib.h>. In the NO_FP_API case, don't include <stdio.h>.
Ulf Möller [Thu, 1 Jun 2000 19:34:25 +0000 (19:34 +0000)]
Don't include <stdlib.h>. In the NO_FP_API case, don't include <stdio.h>.

24 years agoSmall documentation bug, probably a cut'n'paste, corrected.
Richard Levitte [Thu, 1 Jun 2000 17:40:34 +0000 (17:40 +0000)]
Small documentation bug, probably a cut'n'paste, corrected.

24 years agoBug fix for 64 bit HP-UX.
Ulf Möller [Thu, 1 Jun 2000 14:24:59 +0000 (14:24 +0000)]
Bug fix for 64 bit HP-UX.

Submitted by: Karsten Spang <ks@bellesystems.com>

24 years agoSmall fix to enable reading from stdin as well.
Richard Levitte [Thu, 1 Jun 2000 11:23:20 +0000 (11:23 +0000)]
Small fix to enable reading from stdin as well.
Contributed by Yoichiro Okabe <okabe@wizsoft.co.jp>

24 years ago"make update" + stripping the type-specific stack functions out of
Geoff Thorpe [Thu, 1 Jun 2000 06:07:19 +0000 (06:07 +0000)]
"make update" + stripping the type-specific stack functions out of
libeay.num and ssleay.num.

24 years agoThis change will cause builds (by default) to not use different STACK
Geoff Thorpe [Thu, 1 Jun 2000 05:13:52 +0000 (05:13 +0000)]
This change will cause builds (by default) to not use different STACK
structures and functions for each stack type. The previous behaviour
can be enabled by configuring with the "-DDEBUG_SAFESTACK" option.
This will also cause "make update" (mkdef.pl in particular) to
update the libeay.num and ssleay.num symbol tables with the number of
extra functions DEBUG_SAFESTACK creates.

The way this change works is to accompany each DECLARE_STACK_OF()
macro with a set of "#define"d versions of the sk_##type##_***
functions that ensures all the existing "type-safe" stack calls are
precompiled into the underlying stack calls. The presence or abscence
of the DEBUG_SAFESTACK symbol controls whether this block of
"#define"s or the DECLARE_STACK_OF() macro is taking effect. The
block of "#define"s is in turn generated and maintained by a perl
script (util/mkstack.pl) that encompasses the block with delimiting
C comments. This works in a similar way to the auto-generated error
codes and, like the other such maintenance utilities, is invoked
by the "make update" target.

A long (but mundane) commit will follow this with the results of
"make update" - this will include all the "#define" blocks for
each DECLARE_STACK_OF() statement, along with stripped down
libeay.num and ssleay.num files.

24 years agoThe previous commit to crypto/stack/*.[ch] pulled the type-safety strings
Geoff Thorpe [Thu, 1 Jun 2000 02:36:58 +0000 (02:36 +0000)]
The previous commit to crypto/stack/*.[ch] pulled the type-safety strings
yet tighter, and also put some heat on the rest of the library by
insisting (correctly) that compare callbacks used in stacks are prototyped
with "const" parameters. This has led to a depth-first explosion of
compiler warnings in the code where 1 constification has led to 3 or 4
more. Fortunately these have all been resolved to completion and the code
seems cleaner as a result - in particular many of the _cmp() functions
should have been prototyped with "const"s, and now are. There was one
little problem however;

X509_cmp() should by rights compare "const X509 *" pointers, and it is now
declared as such. However, it's internal workings can involve
recalculating hash values and extensions if they have not already been
setup. Someone with a more intricate understanding of the flow control of
X509 might be able to tighten this up, but for now - this seemed the
obvious place to stop the "depth-first" constification of the code by
using an evil cast (they have migrated all the way here from safestack.h).

Fortunately, this is the only place in the code where this was required
to complete these type-safety changes, and it's reasonably clear and
commented, and seemed the least unacceptable of the options. Trying to
take the constification further ends up exploding out considerably, and
indeed leads directly into generalised ASN functions which are not likely
to cooperate well with this.

24 years agoThis is the first of two commits (didn't want to dump them all into the
Geoff Thorpe [Thu, 1 Jun 2000 02:15:40 +0000 (02:15 +0000)]
This is the first of two commits (didn't want to dump them all into the
same one). However, the first will temporarily break things until the
second comes through. :-)

The safestack.h handling was mapping compare callbacks that externally
are of the type (int (*)(type **,type **)) into the underlying callback
type used by stack.[ch], which is (int (*)(void *,void *)). After some
degree of digging, it appears that the callback type in the underlying
stack code should use double pointers too - when the compare operations
are invoked (from sk_find and sk_sort), they are being used by bsearch
and qsort to compare two pointers to pointers. This change corrects the
prototyping (by only casting to the (void*,void*) form at the moment
it is needed by bsearch and qsort) and makes the mapping in safestack.h
more transparent. It also changes from "void*" to "char*" to stay in
keeping with stack.[ch]'s assumed base type of "char".

Also - the "const" situation was that safestack.h was throwing away
"const"s, and to compound the problem - a close examination of stack.c
showed that (const char **) is not really achieving what it is supposed
to when the callback is being invoked, what is needed is
(const char * const *). So the underlying stack.[ch] and the mapping
macros in safestack.h have all been altered to correct this.

What will follow are the vast quantities of "const" corrections required
in stack-dependant code that was being let "slip" through when
safestack.h was discarding "const"s. These now all come up as compiler
warnings.

24 years agois needed.
Ulf Möller [Thu, 1 Jun 2000 00:27:59 +0000 (00:27 +0000)]
is needed.

24 years agotypo
Bodo Möller [Wed, 31 May 2000 23:20:10 +0000 (23:20 +0000)]
typo

24 years agodh and gendh have been obsoleted by dhparam.
Bodo Möller [Wed, 31 May 2000 23:07:48 +0000 (23:07 +0000)]
dh and gendh have been obsoleted by dhparam.

24 years ago#include <stdio.h> not needed.
Ulf Möller [Wed, 31 May 2000 22:25:44 +0000 (22:25 +0000)]
#include <stdio.h> not needed.

24 years ago#include <stdlib.h> is not needed.
Ulf Möller [Wed, 31 May 2000 22:13:59 +0000 (22:13 +0000)]
#include <stdlib.h> is not needed.

24 years agoResult of "make update"
Richard Levitte [Wed, 31 May 2000 21:35:38 +0000 (21:35 +0000)]
Result of "make update"

24 years agoThis seems to become a FAQ...
Richard Levitte [Wed, 31 May 2000 20:11:11 +0000 (20:11 +0000)]
This seems to become a FAQ...

24 years agosk_***_new_null() seems to be there to avoid exactly this sort of thing
Geoff Thorpe [Wed, 31 May 2000 17:41:34 +0000 (17:41 +0000)]
sk_***_new_null() seems to be there to avoid exactly this sort of thing
which is a cast between NULL and a function pointer.

24 years agosk_value was also suffering from de-const-ification.
Geoff Thorpe [Wed, 31 May 2000 17:35:11 +0000 (17:35 +0000)]
sk_value was also suffering from de-const-ification.
Also, add in a couple of missing declarations in pkcs7 code.

24 years agoconfig can now detect ARM Linux automagically.
Richard Levitte [Wed, 31 May 2000 17:06:10 +0000 (17:06 +0000)]
config can now detect ARM Linux automagically.
Contributed by Jeremy Norris <jeremy.norris@rebel.com>

24 years agostrtoul is not used anywhere.
Bodo Möller [Wed, 31 May 2000 16:44:22 +0000 (16:44 +0000)]
strtoul is not used anywhere.

24 years agoWhen compiling with /opt/SUNWspro/SC4.2/bin/cc on Solaris, __svr4__ is
Bodo Möller [Wed, 31 May 2000 16:42:47 +0000 (16:42 +0000)]
When compiling with /opt/SUNWspro/SC4.2/bin/cc on Solaris, __svr4__ is
not defined, but __SVR4 is.

24 years agoAll the little functions created by the IMPLEMENT_STACK_OF() macro will
Geoff Thorpe [Wed, 31 May 2000 15:28:01 +0000 (15:28 +0000)]
All the little functions created by the IMPLEMENT_STACK_OF() macro will
cast their type-specific STACK into a real STACK and call the underlying
sk_*** function. The problem is that if the STACK_OF(..) parameter being
passed in has a "const *" qualifier, it is discarded by the cast.

I'm currently implementing a fix for this but in the mean-time, this is
one case I noticed (a few type-specific sk_**_num() functions pass in
const type-specific stacks). If there are other errors in the code where
consts are being discarded, we will similarly not notice them. yuck.

24 years agoMove Windows seeding functions into a separate file.
Bodo Möller [Wed, 31 May 2000 12:48:35 +0000 (12:48 +0000)]
Move Windows seeding functions into a separate file.
They have nothing to do with the particular PRNG (md_rand.c).