Commit Graph

1079 Commits

Author SHA1 Message Date
Bodo Möller
6dad7bd69c Speed up DH with small generator. 2000-06-07 21:29:25 +00:00
Andy Polyakov
9887c71c41 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'...
2000-06-06 15:21:12 +00:00
Andy Polyakov
e6441154fc GCC 2.95.2 from IRIX 6.5 -mabi=64 compiler bug workaround:-(
Submitted by:
Reviewed by:
PR:
2000-06-05 14:39:47 +00:00
Bodo Möller
849c0e3046 int may be smaller than 32 bits. 2000-06-05 13:50:57 +00:00
Richard Levitte
823d8a6eb1 According to Gordon Atwood <gordon@cs.ualberta.ca>, stdlib.h is
needed, or size_t won't be defined on SunOS 4.1.4.
2000-06-04 07:12:20 +00:00
Ben Laurie
1921eaad64 EVP constification. 2000-06-03 14:13:58 +00:00
Richard Levitte
26a3a48d65 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.
2000-06-01 22:19:21 +00:00
Ulf Möller
de42b6a7a8 Use NO_FP_API. 2000-06-01 20:25:44 +00:00
Ulf Möller
922ebc7b0d Don't include <stdlib.h>. In the NO_FP_API case, don't include <stdio.h>. 2000-06-01 19:34:25 +00:00
Ulf Möller
db82b8f9bd Bug fix for 64 bit HP-UX.
Submitted by: Karsten Spang <ks@bellesystems.com>
2000-06-01 14:24:59 +00:00
Geoff Thorpe
7edd20916a "make update" + stripping the type-specific stack functions out of
libeay.num and ssleay.num.
2000-06-01 06:07:19 +00:00
Geoff Thorpe
e41c8d6ad4 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.
2000-06-01 05:13:52 +00:00
Geoff Thorpe
ccd86b68ef 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.
2000-06-01 02:36:58 +00:00
Geoff Thorpe
7bb7043580 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.
2000-06-01 02:15:40 +00:00
Ulf Möller
f3e9b338e0 is needed. 2000-06-01 00:27:59 +00:00
Ulf Möller
2453890463 #include <stdio.h> not needed. 2000-05-31 22:25:44 +00:00
Ulf Möller
78e2426859 #include <stdlib.h> is not needed. 2000-05-31 22:13:59 +00:00
Geoff Thorpe
a4e31088ce sk_***_new_null() seems to be there to avoid exactly this sort of thing
which is a cast between NULL and a function pointer.
2000-05-31 17:41:34 +00:00
Geoff Thorpe
e20d7d7167 sk_value was also suffering from de-const-ification.
Also, add in a couple of missing declarations in pkcs7 code.
2000-05-31 17:35:11 +00:00
Geoff Thorpe
01296a6de0 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.
2000-05-31 15:28:01 +00:00
Bodo Möller
2ace287dea Move Windows seeding functions into a separate file.
They have nothing to do with the particular PRNG (md_rand.c).
2000-05-31 12:48:35 +00:00
Bodo Möller
939fff6799 Add "FIXME" comment. 2000-05-31 09:51:55 +00:00
Bodo Möller
361ee9733f Improve PRNG robustness. 2000-05-30 21:44:36 +00:00
Dr. Stephen Henson
49528751b8 More EVP cipher revision.
Change EVP_SealInit() and EVP_OpenInit() to
handle cipher parameters.

Make it possible to set RC2 and RC5 params.

Make RC2 ASN1 code use the effective key bits
and not the key length.

TODO: document how new API works.
2000-05-30 18:26:22 +00:00
Dr. Stephen Henson
5da2f69f41 Fourth phase EVP revision.
Declare ciphers in terms of macros. This reduces
the amount of code and places each block cipher EVP
definition in a single file instead of being spread
over 4 files.
2000-05-30 02:21:15 +00:00
Dr. Stephen Henson
57ae2e2428 Fourth phase EVP revision.
Declare ciphers in terms of macros. This reduces
the amount of code and places each block cipher EVP
definition in a single file instead of being spread
over 4 files.
2000-05-30 02:10:57 +00:00
Geoff Thorpe
8c343cf861 another warning. 2000-05-29 04:20:52 +00:00
Geoff Thorpe
4dbe060f2c It seems that mktime does what is required here. Certainly timegm() can
not be used because it is not available on all systems (most notably,
win32).
2000-05-29 03:50:37 +00:00
Geoff Thorpe
e212226828 This declaration seems to have been added into the header file accidently.
There's no trace of it being implemented and it doesn't seem to have been
intended given that it is prototyped with a BIO yet there was a BIO-
specific version added in at the same time.
2000-05-29 03:17:45 +00:00
Geoff Thorpe
e9e6b88b35 oops. 2000-05-29 02:42:57 +00:00
Dr. Stephen Henson
360370d953 Third phase of EVP cipher overhaul.
Remove duplicated code in EVP.
2000-05-28 12:44:46 +00:00
Dr. Stephen Henson
be06a9348d Second phase of EVP cipher overhaul.
Change functions like EVP_EncryptUpdate() so they now return a
value. These normally have software only implementations
which cannot fail so this was acceptable. However ciphers
can be implemented in hardware and these could return errors.
2000-05-27 12:38:43 +00:00
Dr. Stephen Henson
7f0606016c Beginnings of EVP cipher overhaul. This should eventually
enhance and tidy up the EVP interface.

This patch adds initial support for variable length ciphers
and changes S/MIME code to use this.

Some other library functions need modifying to support use
of modified cipher parameters.

Also need to change all the cipher functions that should
return error codes, but currenly don't.

And of course it needs extensive testing...
2000-05-26 23:51:35 +00:00
Dr. Stephen Henson
b4b41f48d1 Add DSA library string. Workaround for IIS .key file invalid
ASN1 encoding.
2000-05-24 13:09:59 +00:00
Ben Laurie
4d29312ce1 Yet more typesafety. 2000-05-21 15:21:55 +00:00
Bodo Möller
c95b7a723f Fix "FIXME" indentation :-) 2000-05-19 12:02:09 +00:00
Bodo Möller
5569e1c39a Add "FIXME" comment, and adjust the indentation. 2000-05-19 11:59:55 +00:00
Dr. Stephen Henson
439df5087f Fix c_rehash script, add -fingerprint option to crl. 2000-05-18 00:33:00 +00:00
Ben Laurie
0d3b0afe9e Typesafety Thought Police last part. 2000-05-17 10:08:05 +00:00
Ben Laurie
abc9400e10 Typesafety Thought Police part 5. 2000-05-17 09:13:36 +00:00
Ben Laurie
371acb22e6 Typesafe Thought Police part 4. 2000-05-16 23:01:19 +00:00
Ben Laurie
5de603abc8 Typesafety Thought Police part 3. 2000-05-16 21:22:45 +00:00
Ben Laurie
f2716dada0 Typesafety Thought Police Part 2. 2000-05-16 19:53:50 +00:00
Ulf Möller
0e1c06128a Get rid of more non-ANSI declarations. 2000-05-15 22:54:43 +00:00
Ulf Möller
0c109ea2cb prototype. 2000-05-15 21:02:44 +00:00
Ulf Möller
911ea946cb Make sure that NO-RSA applications etc can include evp.h 2000-05-15 19:24:23 +00:00
Ulf Möller
991f0706d8 MacOS changes. 2000-05-15 18:59:55 +00:00
Ben Laurie
fd73a2121c Allow UTCTIME objects to be retrieved. Check for imminent cert expiry. 2000-05-14 12:39:53 +00:00
Bodo Möller
50e4e9283d When open()ing 'file' in RAND_write_file, don't use O_EXCL.
This is superfluous now that we don't have to avoid creating
multiple versions of the file on VMS (because older versions
are now deleted).
2000-05-11 23:10:27 +00:00
Dr. Stephen Henson
0cb957a684 Fix for SSL server purpose checking 2000-05-04 23:03:49 +00:00