Commit graph

2185 commits

Author SHA1 Message Date
Richard Levitte
9a4051050c Geoff inspired me to nullify some pointers if initialisation went
wrong.  Additionally, just give a new value to hndidx once.
2000-06-14 16:57:57 +00:00
Geoff Thorpe
4c4ea428cc DSO_bind() is effectively a method-specific wrapper for dlopen() or
whatever the underlying API is. It must return (void *) because shared
libraries can expose functions, structures, or whatever. However, some
compilers give loads of warnings about casted function pointers through
this code, so I am explicitly casting them to the right prototypes.
2000-06-14 14:28:16 +00:00
Geoff Thorpe
28e94dc70d I'm working on Atalla ENGINE code, and the existing bn_exp.c hooks
(initiated by ./config and the presence of SDK headers) are conflicting.
2000-06-14 13:27:47 +00:00
Geoff Thorpe
f812743544 If initialisation fails for any reason, the global function pointers
should be NULL'd out.
2000-06-14 13:24:37 +00:00
Geoff Thorpe
87f3435f78 This hooks the "hwcrhk" engine Richard just submitted into the default
engine list if HW_NCIPHER is defined. I want to play :-)
2000-06-13 18:11:38 +00:00
Richard Levitte
86787f93d6 - merged in the latest from the main trunk, fixed all conflicts
- implemented nCipher support via the nfhwcrhk library (not well tested).
- make update + make depend
2000-06-13 16:21:06 +00:00
Geoff Thorpe
05d909c549 * Migrate the engine code's Malloc + Free calls to the newer
OPENSSL_malloc and OPENSSL_free.

* 3 "normal" files (crypto/rsa/rsa_lib.c, crypto/dsa/dsa_lib.c
  and crypto/dh/dh_lib.c) had their Malloc's and Free's missed
  when Richard merged the changes across to this branch -
  probably because those files have been changed in this branch
  and gave some grief to the merge - so I've changed them
  manually here.
2000-06-09 11:42:02 +00:00
Richard Levitte
d44c7dcf00 Merge in code from main trunk to BRANCH_engine. 2000-06-08 11:00:37 +00:00
cvs2svn
5decfb7002 This commit was manufactured by cvs2svn to create branch 'BRANCH_engine'. 2000-06-01 22:19:22 +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
Richard Levitte
b194041adf Small documentation bug, probably a cut'n'paste, corrected. 2000-06-01 17:40:34 +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
Richard Levitte
a9ef75c50d Small fix to enable reading from stdin as well.
Contributed by Yoichiro Okabe <okabe@wizsoft.co.jp>
2000-06-01 11:23:20 +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
Bodo Möller
cbb6ad9d10 typo 2000-05-31 23:20:10 +00:00
Bodo Möller
727daea783 dh and gendh have been obsoleted by dhparam. 2000-05-31 23:07:48 +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
Richard Levitte
602ef2ae00 Result of "make update" 2000-05-31 21:35:38 +00:00
Richard Levitte
31efc3a78d This seems to become a FAQ... 2000-05-31 20:11:11 +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
Richard Levitte
b108611622 config can now detect ARM Linux automagically.
Contributed by Jeremy Norris <jeremy.norris@rebel.com>
2000-05-31 17:06:10 +00:00
Bodo Möller
15e98129b2 strtoul is not used anywhere. 2000-05-31 16:44:22 +00:00
Bodo Möller
af463e7e19 When compiling with /opt/SUNWspro/SC4.2/bin/cc on Solaris, __svr4__ is
not defined, but __SVR4 is.
2000-05-31 16:42:47 +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
Geoff Thorpe
50008364a6 Update the relevant parts of the docs with the ENGINE changes. I've also
unbolded a few bits that looked unecessary.
2000-05-30 13:52:45 +00:00
Geoff Thorpe
547bf7f983 "make update"
Also, corrects the linux-elf-arm config string, it was previously setting
$des_obj = dlfcn :-)
2000-05-30 12:59:43 +00:00
Richard Levitte
fbecbc8cfb You must have an empty line between =item's 2000-05-30 08:01:24 +00:00
Richard Levitte
6a1129837a Main trunk changes merged into BRANCH_engine. There were no
conflicts, which is a good thing.  Propper tagging of merge point
done.
2000-05-30 07:16:56 +00:00
cvs2svn
20ca3d49e7 This commit was manufactured by cvs2svn to create branch 'BRANCH_engine'. 2000-05-30 02:21:16 +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
f156d5495d "handle", "h" and even "e" were probably not the best terms to use. The
original idea of "handle" was that it represented a functional reference
to an ENGINE (rather than just a pointer), but on reflection I think
this now looks a little more readable.
2000-05-29 16:24:42 +00:00
Richard Levitte
380d3aa6be Configuration for linux on ARM (contributed by Jeremy Norris
<jeremy.norris@rebel.com>)
2000-05-29 16:18:37 +00:00
Geoff Thorpe
4c0aee5a75 Minor corrections to documentation.
* speed processes any/all options passed to it, not just one.
* DH and DSA have no "_get_method()" functions, only RSA does.
* typos.
2000-05-29 15:52:21 +00:00
Geoff Thorpe
96d7e0ece7 This adds DSA signature verification to the CryptoSwift support. 2000-05-29 13:01:34 +00:00
Geoff Thorpe
974e22704d "make update" 2000-05-29 11:21:29 +00:00
Geoff Thorpe
835475a2d6 Tie DSA into the engine framework as with RSA and DH so far. I've verified
this integration with a web-server using CryptoSwift engine code with RSA
and DSA certificates (and with EDH cipher suites).
2000-05-29 11:07:38 +00:00
Geoff Thorpe
a26f2b5e62 General tidy up of existing code, and add first half of DSA support for
CryptoSwift (this currently only does signing, verification will be
hooked in shortly).
2000-05-29 10:59:46 +00:00