Commit graph

1312 commits

Author SHA1 Message Date
Richard Levitte
7abee0cedf Jeffrey Altman convinced me this patch was really needed, or there is
no way to make sure GetCursorInfo will give us a valid answer.
2000-09-14 09:19:19 +00:00
Ulf Möller
24b8bf2163 Point to Peter Gutmann's revised paper.
The copy at www.usenix.org is the old version.
2000-09-13 14:24:07 +00:00
Richard Levitte
c0366d89f6 3 changes:
- Make sure PCURSORINFO is defined even on systems that do not provide it.
- Change the reference to Peter Gutmann's paper.
- Make sure we don't walk the whole heap lists for performance reasons.
  Jeffrey Altman suggests following Peter Gutmann's advice to keep it
  to 50 heap entries per heap list.
2000-09-13 07:17:35 +00:00
Ulf Möller
c11dead17c Don't set the two top bits to one when generating a random number < q.:wq 2000-09-13 01:45:54 +00:00
Richard Levitte
74d2b0f112 Don't include e_os.h before the system headers 2000-09-11 16:37:36 +00:00
Richard Levitte
bed1847b6a Time to release a beta. Change the version numbers and dates
accordingly.
2000-09-11 12:31:36 +00:00
Richard Levitte
25a73f2690 A cast is needed or Borland C will complain. 2000-09-11 11:43:35 +00:00
Richard Levitte
97d8e82c4c Marin Kraemer <Martin.Kraemer@MchP.Siemens.De> sent us patches to make
the OpenSSL commands x50 and req work better on a EBCDIC system.
2000-09-10 14:45:19 +00:00
Richard Levitte
0baed24c1b More VMS synchronisation 2000-09-09 18:05:27 +00:00
Ulf Möller
4f7068c165 Fix some CygWin problems. 2000-09-09 04:45:18 +00:00
Richard Levitte
eec79f9bab Synchronise the VMS build with the Unix one. 2000-09-08 20:25:49 +00:00
Richard Levitte
a1b15ac21f Two places where I forgot to change vms_idhacks to symhacks. 2000-09-08 06:28:09 +00:00
Dr. Stephen Henson
84b65340e1 Two new PKCS#12 demo programs.
Update PKCS12_parse().

Make the keyid in certificate aux info more usable.
2000-09-07 23:14:26 +00:00
Dr. Stephen Henson
f50c11ca40 Ugh, BIO_find_type() cannot be passed a NULL.
Fix doc example, and fix BIO_find_type().

Fix PKCS7_verify(). It was using 'i' for both the
loop variable and the verify return value.
2000-09-07 17:42:25 +00:00
Dr. Stephen Henson
cfd3bb1785 Add docs for BIO_find_type() and friends.
Added function BIO_next() otherwise you can't
traverse a chain without accessing BIO internals.
2000-09-07 13:04:27 +00:00
Richard Levitte
62ab514e98 'make update' 2000-09-07 08:46:51 +00:00
Richard Levitte
9fc2570677 It's not just VMS that needs some symbols to be hacked. Let's
centralise those hacks in crypto/symhacks.h and use it everywhere it's
needed.
2000-09-07 08:18:05 +00:00
Richard Levitte
827dbcb150 Change the printing mahine used by BIO_printf() and friends so it can
handle an externally provided "static" buffer as well a a dynamic
buffer.  The "static" buffer is filled first, but if overflowed, the
dynamic buffer is used instead, being allocated somewhere i the heap.

This combines the benefits of putting the output in a preallocated
buffer (on the stack, for example) and in a buffer that grows
somewhere in the heap.
2000-09-07 05:50:14 +00:00
Bodo Möller
61f175f4ba Get rid of ASN1_UTCTIME_get, which cannot work with time_t
return type (on platforms where time_t is a 32 bit value).

New function ASN1_UTCTIME_cmp_time_t as a replacement
for use in apps/x509.c.
2000-09-06 15:40:52 +00:00
Bodo Möller
15387be289 Another superfluous pair of parentheses. 2000-09-06 14:34:32 +00:00
Bodo Möller
f684090cbe Another round of indentation changes: Position braces consistently,
add some whitespace for 'if ()', 'for ()', 'while ()' to distinguish
keywords from function names, and finally remove parens around return
values (why be stingy with whitespace but fill the source code
with an abundance of parentheses that are not needed to structure
expressions for readability?).
2000-09-06 14:14:20 +00:00
Bodo Möller
b7c190d97b More indentation consistency: for (), while (), if (), return ()
usually get a space between keyword and opening paranthesis
so that they don't look like function calls, where no space is
used.
2000-09-06 13:31:44 +00:00
Bodo Möller
82aec1cc35 Fix X509_STORE_CTX_init. Make indentation more consistent. Dump core less often. 2000-09-06 13:24:10 +00:00
Bodo Möller
75cb225989 'make update' 2000-09-06 12:34:10 +00:00
Dr. Stephen Henson
bbb720034a Fix typo in rsautl.
Add support for settable verify time in X509_verify_cert().

Document rsautl utility.
2000-09-05 22:30:38 +00:00
Dr. Stephen Henson
2f043896d1 *BIG* verify code reorganisation.
The old code was painfully primitive and couldn't handle
distinct certificates using the same subject name.

The new code performs several tests on a candidate issuer
certificate based on certificate extensions.

It also adds several callbacks to X509_VERIFY_CTX so its
behaviour can be customised.

Unfortunately some hackery was needed to persuade X509_STORE
to tolerate this. This should go away when X509_STORE is
replaced, sometime...

This must have broken something though :-(
2000-09-05 17:53:58 +00:00
Dr. Stephen Henson
34216c0422 Keep a not of original encoding in certificate requests.
Add new option to PKCS7_sign to exclude S/MIME capabilities.
2000-09-05 13:27:57 +00:00
Bodo Möller
29dc25e88a Increase print buffer (10K instead of just 2K). 2000-09-05 12:43:39 +00:00
Bodo Möller
0572abbf53 Ignore Makefile.save 2000-09-05 12:42:05 +00:00
Bodo Möller
7d95ff76e6 Remove silly test for b->references at the end of BIO_write:
If some other thread deletes the BIO that one thread needs for
BIO_write, then there's a lot of trouble anyway; there's
nothing special about calling the callback.
2000-09-05 12:35:00 +00:00
Bodo Möller
affadbef0b Consistency 2000-09-04 15:47:17 +00:00
Bodo Möller
397bd0938a Use consistent indentation, 2000-09-04 15:38:02 +00:00
Bodo Möller
bbb8de0966 Avoid abort() throughout the library, except when preprocessor
symbols for debugging are defined.
2000-09-04 15:34:43 +00:00
Bodo Möller
5e38616380 Fix for BN_mul_word(a, 0). 2000-09-04 15:30:14 +00:00
Bodo Möller
04a3ae5592 Tell CVS to ignore 'lib'. 2000-09-04 15:27:47 +00:00
Dr. Stephen Henson
bd08a2bd0c Add 'rsautl' low level RSA utility.
Add DER public key routines.

Add -passin argument to 'ca' utility.

Document sign and verify options to dgst.
2000-09-03 23:13:48 +00:00
Bodo Möller
55ac522068 Undo change from 1.7 to 1.8:
Returning -1 for an attempt to read from an empty buffer is empty is
not an error that should be signalled via the error queue, it's a
'retry read' condition and is signalled as such.
2000-09-01 12:29:14 +00:00
Bodo Möller
ccc265eaa7 Use C syntax, not FORTRAN or whatever that was :-) 2000-09-01 10:40:37 +00:00
Dr. Stephen Henson
7df1c720f6 Fix typo in i2d_ASN1_ENUMERATED
Fix bug in read only memory BIOs so BIO_reset() works.

Add sign and verify options to dgst utility, need
to update docs.
2000-08-30 16:14:29 +00:00
Ben Laurie
b3756cf0e9 Diagnose EOF on memory BIOs (or you just get mysterious errors with no error
message).
2000-08-28 12:54:18 +00:00
Ben Laurie
065866b28d Use the passed buffer in ERR_error_string! 2000-08-28 10:57:01 +00:00
Dr. Stephen Henson
d428bf8c56 New option to CA.pl to sign request using CA extensions.
This allows intermediate CAs to be created more easily.

PKCS12_create() now checks private key matches certificate.

Fix typo in x509 app.

Update docs.

New function ASN1_STRING_to_UTF8() converts any ASN1_STRING
type to UTF8.
2000-08-24 23:24:18 +00:00
Dr. Stephen Henson
d096b524af Add support for 'other' PKCS#7 content types. 2000-08-22 22:20:25 +00:00
Ben Laurie
c9b51693dc max -> dmax in bn_check_top. 2000-08-22 21:23:09 +00:00
Dr. Stephen Henson
cae0ae2e4b Fix ASN1_INTEGER_to_BN properly this time... 2000-08-22 16:06:24 +00:00
Dr. Stephen Henson
469938cb40 Fixes to d2i_ASN1_OBJECT, ASN1_INTEGER_to_BN and a_strex.c 2000-08-22 12:54:21 +00:00
Dr. Stephen Henson
eaa2818189 Various fixes...
initialize ex_pathlen to -1 so it isn't checked if pathlen
is not present.

set ucert to NULL in apps/pkcs12.c otherwise it gets freed
twice.

remove extraneous '\r' in MIME encoder.

Allow a NULL to be passed to X509_gmtime_adj()


Make PKCS#7 code use definite length encoding rather then
the indefinite stuff it used previously.
2000-08-21 22:02:23 +00:00
Richard Levitte
622ec449e5 Added OIDs from RFC 2247, 1155, and a few from 1700 2000-08-19 08:47:59 +00:00
Richard Levitte
e6629837a9 Added BIO_vprintf() and BIO_vsnprintf(). The former because I've
found myself needing it a number of times, the latter for completeness.
2000-08-18 09:36:59 +00:00
Richard Levitte
97a377b973 NULL is not an integer... 2000-08-18 09:30:31 +00:00
Richard Levitte
0f4e21360d Add more diversity to the possible log levels. Now we have full
coverage for all syslog level.
2000-08-17 23:15:53 +00:00
Richard Levitte
d03e0f3411 Added md4 to the VMS compilation 2000-08-17 22:43:31 +00:00
Richard Levitte
3009458e2f MD4 implemented. Assar Westerlund provided the digest code itself and the test utility, I added the bits to get a EVP interface, the command line utility and the speed test 2000-08-14 14:05:53 +00:00
Richard Levitte
35140f3354 Abdelilah Essiari <aes@george.lbl.gov> reports that for very small
records, EVP_EncodeUpdate() may misbehave.  This happens when there's
a record boundary between the two ending b64 equal signs, which makes
EVP_EncodeUpdate think there has been more than one EOF, and therefore
add an extra NUL at the end of the output buffer.  This fix corrects
that problem.
2000-08-11 08:36:25 +00:00
Richard Levitte
15c2e1260b Duplicate names detected... 2000-08-10 01:48:49 +00:00
Richard Levitte
d309394447 Make sure that 'initialized' is zeroed as well when cleaning up. 2000-08-08 15:06:44 +00:00
Dr. Stephen Henson
d4fbe3182d Fix for bad sorting of object names.
Add warning print out if duplicate names found:
should end up as a fatal error but a warning for
now until they problems are fixed...
2000-08-06 18:43:32 +00:00
Richard Levitte
5584fa1709 For n > 7, we might get uninitialized (unzeroed) data.
Spotted by "Kyoungho Jeon" <k.h.jeon@securesoft.co.kr>.
2000-08-06 01:35:03 +00:00
Dr. Stephen Henson
2d978cbd30 Changes needed for Tandem NSK, supplied by Scott Uroff (scott@xypro.com).
Fix warnings with BIO_dump_indent().
2000-08-04 00:01:39 +00:00
Richard Levitte
0a3f67e3b0 On Unicos, shorts are 8 bytes, so instead, use a structure with 2 32-bit ints, just as in destest.c 2000-08-03 21:58:56 +00:00
Richard Levitte
ea58130d1a On Unicos, openlog() isn't constified, so let's not do that in xopenlog() 2000-08-03 21:56:36 +00:00
Richard Levitte
51b66427c9 *mumble* unicos 10.0.0.3 with Cray Standard C Version 6.2.0.0 has a syslog.h
where the openlog() is declared like this:

  extern int openlog __((char *_Ident, int _Logopt, int _Facility));
2000-08-02 23:05:15 +00:00
Richard Levitte
e5acb2bd2e Remove casts that are no longer needed. 2000-08-01 08:41:13 +00:00
Richard Levitte
173e243aae If a ip address is successfully parsed, the WSA structure under Win32 wasn't
properly initialised.  Fixed.
Bug reported by DeJuan Jackson <djackson@inverge.com>
2000-07-31 22:49:27 +00:00
Dr. Stephen Henson
bd4e152791 Document the new DN printing options.
Change a few names to be more meaningful.

Fix typos in CA.pl docs.
2000-07-30 01:27:59 +00:00
Bodo Möller
37569e64e8 Fix SSL 2.0 rollback checking: The previous implementation of the
test was never triggered due to an off-by-one error.

In s23_clnt.c, don't use special rollback-attack detection padding
(RSA_SSLV23_PADDING) if SSL 2.0 is the only protocol enabled in the
client; similarly, in s23_srvr.c, don't do the rollback check if
SSL 2.0 is the only protocol enabled in the server.
2000-07-29 18:50:41 +00:00
Dr. Stephen Henson
a657546f9c New ASN1_STRING_print_ex() and X509_NAME_print_ex()
functions. These are intended to be replacements
for the ancient ASN1_STRING_print() and X509_NAME_print()
functions.

The new functions support RFC2253 and various pretty
printing options. It is also possible to display
international characters if the terminal properly handles
UTF8 encoding (Linux seems to tolerate this if the
"unicode_start" script is run).

Still needs to be documented, integrated into other
utilities and extensively tested.
2000-07-28 01:58:15 +00:00
Richard Levitte
8083e1bd9e There's a slight possibility that a is 0 in BN_sub_word(), and might
therefore have unallocated parts.  Therefore, a check for the 0 case
is needed, resulting with the same thing as when a is negative.
2000-07-27 21:32:23 +00:00
Richard Levitte
8b4e27e26e In the case where a < 0 and |a| < w, the result (assigned to a) from
BN_add_word becomes wrongly negative...
This was discovered by Darrel Hankerson <dhankers@cacr.math.uwaterloo.ca>
2000-07-27 21:17:14 +00:00
Richard Levitte
d6ade7422a Looks like Win32 builds do not define THREADS. However, they're still
supporting threads, which means that th assertion is supperbly
dangerous, so make sure it's not compiled under Win32, period.
2000-07-27 20:14:39 +00:00
Richard Levitte
ca1e465f6d Add the possibility to get hexdumps of unprintable data when using
'openssl asn1parse'.  As a side effect, the functions ASN1_parse_dump
and BIO_dump_indent are added.
2000-07-27 17:28:25 +00:00
Dr. Stephen Henson
f6c1c9e95d Fix a bug in the new i2d_{ENUMERATED,INTEGER} that
didn't recognise NULL to mean 'don't output anything'
2000-07-27 01:27:22 +00:00
Richard Levitte
2dbef509e2 When data are written out in very small blocks (less than 3 bytes in
size) through the base64 filter, b64_write() messes up it's parameters
in such a way that instead of writing correct base64 output, the first
4 characters of that output is repeated over and over.  This fix
corrects that problem.
2000-07-26 16:53:58 +00:00
Richard Levitte
a4125514f5 There's a deadlock when ssleay_rand_bytes is called the first time, since
it wants to stir the pool using ssleay_rand_add.  This fix provides the
possibility to call ssleay_rand_add inside a locked state by simply telling
it not to do any locking through a static variable.  This isn't the most
elegant way one could do this, but it does retain thread safety during the
stirring process.
2000-07-26 08:32:00 +00:00
Dr. Stephen Henson
033d001e90 Fix warnings.
In crypto/err/err.c need to initialise p to
NULL in case thread_hash is NULL. Otherwise
p will be uninitialized.
2000-07-26 01:39:23 +00:00
Dr. Stephen Henson
284ef5f357 Make NEG_PUBKEY_BUG on by default.
ASN1_TIME fixes.

New function c2i_ASN1_OBJECT().
2000-07-26 01:18:37 +00:00
Richard Levitte
47ff5de8c2 Darrel Hankerson <dhankers@cacr.math.uwaterloo.ca> correctly discovered
that of the result pointer to bn_mul was the same as one of the two arguments,
That argument might have it's sign destroyed.  He provided this fix.
2000-07-26 01:14:16 +00:00
Richard Levitte
34f0fe9de0 Avoid a race condition if another thread happens to remove the error
state at the same time.
2000-07-25 16:56:39 +00:00
Richard Levitte
f944e7845c "make update" 2000-07-24 10:02:47 +00:00
Richard Levitte
b436a98257 Redo and enhance the support for building shared libraries. Currently
there's support for building under Linux and True64 (using examples
from the programming manuals), including versioning that is currently
the same as OpenSSL versions but should really be a different series.

With this change, it's up to the users to decide if they want shared
libraries as well as the static ones.  This decision now has to be
done at configuration time (well, not really, those who know what they
do can still do it the same way as before).

The OpenSSL programs (openssl and the test programs) are currently
always linked statically, but this may change in the future in a
configurable manner.  The necessary makefile variables to enable this
are in place.

Also note that I have done absolutely nothing about the Windows target
to get something similar.  On the other hand, DLLs are already the
default there, but without versioning, and I've no idea what the
possibilities for such a thing are there...
2000-07-21 15:08:53 +00:00
Bodo Möller
2d789604b8 Bugfix: use write locks, not just read locks 2000-07-21 15:07:56 +00:00
Ulf Möller
2ad3c4c89e oops. 2000-07-21 02:14:15 +00:00
Ulf Möller
3866db2d5a don't print debug output 2000-07-21 01:13:26 +00:00
Ulf Möller
8ad7635ec9 Move RNG initialization to RAND_poll(), and shared definitions to
rand_lcl.h
2000-07-19 21:43:23 +00:00
Ulf Möller
c0722725f9 Randomness polling function for Win9x. 2000-07-19 21:35:35 +00:00
Dr. Stephen Henson
094fe66d9f Fix some typose in the i2d/d2i functions that
call the i2c/c2i (they were not using the
content length for the headers).

Fix ASN1 long form tag encoding. This never
worked but it was never tested since it is
only used for tags > 30.

New options to smime program to allow the
PKCS#7 format to be specified and the content
supplied externally.
2000-07-10 18:33:05 +00:00
Richard Levitte
27d7260075 Corrected small bug that could add ',L' when it shouldn't 2000-07-08 07:56:12 +00:00
Dr. Stephen Henson
a338e21bd1 New ASN1 functions that just deal with
content octets, not tag+length.
2000-07-07 13:24:36 +00:00
Richard Levitte
c2bbf9cf6c I got sick and tired of having to keep track of NIDs when such a thing
could be done automagically, much like the numbering in libeay.num and
ssleay.num.  The solution works as follows:

  - New object identifiers are inserted in objects.txt, following the
    syntax given in objects.README.
  - objects.pl is used to process obj_mac.num and create a new
    obj_mac.h.
  - obj_dat.pl is used to create a new obj_dat.h, using the data in
    obj_mac.h.

This is currently kind of a hack, and the perl code in objects.pl
isn't very elegant, but it works as I intended.  The simplest way to
check that it worked correctly is to look in obj_dat.h and check the
array nid_objs and make sure the objects haven't moved around (this is
important!).  Additions are OK, as well as consistent name changes.
2000-07-05 02:45:36 +00:00
Bodo Möller
904cb691f3 Return bignum '0' when BN_rand is asked for a 0 bit random number. 2000-07-02 19:42:19 +00:00
Bodo Möller
186a6f4876 Don't dereference NULL pointers.
Submitted by: bowe@chip.ma.certco.com
2000-07-02 18:16:38 +00:00
Ben Laurie
69b5d3c51f Don't let top go below zero! 2000-07-01 16:30:27 +00:00
Richard Levitte
f365611ca3 Undo the changes I just made. I'm not sure what I was thinking of.
The message to everyone is "Do not hack OpenSSL when stressed"...
2000-06-28 16:47:45 +00:00
Richard Levitte
dffd72f171 Make it possible for people to tell where the EGD socket is through
the RANDEGD environment variable.
2000-06-28 16:09:54 +00:00
Richard Levitte
3b3bc455d0 That's it, I've seen questions about this one time too many for
today.  Time to add extra info so the poor users know where to
go with their troubles.
2000-06-28 14:32:12 +00:00
Geoff Thorpe
8ba92cfe81 Steve fixed up some strange errors introduced into dso_win32.c, and I'm
just converting some spaces to tabs from his fix. :-)
2000-06-23 17:29:05 +00:00
Bodo Möller
fc57ebc057 Actually comment out the parts of BN_MOD_MUL_WORD that I inteded to
comment out in the previous commit
2000-06-23 08:10:28 +00:00
Bodo Möller
e958c5afe7 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, ...).
2000-06-23 05:51:37 +00:00
Richard Levitte
ce2d00b2b4 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...
2000-06-22 18:02:23 +00:00
Dr. Stephen Henson
4dd4535441 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 :-(
2000-06-22 00:34:27 +00:00
Ulf Möller
8415060e1e use faster version 2000-06-21 21:20:46 +00:00
Geoff Thorpe
1a797ac67c * 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.
2000-06-21 14:12:25 +00:00
Dr. Stephen Henson
130832150c 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 :-)
2000-06-21 02:25:30 +00:00
Dr. Stephen Henson
7ef8206859 Handle ASN1_SET_OF and PKCS12_STACK_OF using function
casts in the same way as STACK_OF.
2000-06-20 18:45:28 +00:00
Geoff Thorpe
438fa2fdc1 'make update' 2000-06-20 14:06:06 +00:00
Bodo Möller
0f4805f515 Avoid unnecessary links and incomplete program file in apps/. 2000-06-19 17:38:22 +00:00
Richard Levitte
55b7688ef5 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...
2000-06-19 16:38:27 +00:00
Bodo Möller
95a9fea711 Add OPENSSL_free at the end of CRYPTO_destroy_dynlockid. 2000-06-19 13:53:15 +00:00
Richard Levitte
e73a6965e3 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.
2000-06-19 13:38:09 +00:00
Richard Levitte
4b88270ba8 Modifications for VMS. 2000-06-18 16:06:44 +00:00
Richard Levitte
c79223040d 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 :-)).
2000-06-18 15:59:04 +00:00
Bodo Möller
3f39e5ae6c 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.
2000-06-17 23:41:44 +00:00
Dr. Stephen Henson
3aceb94b9e 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.
2000-06-16 23:29:26 +00:00
Richard Levitte
fb3e1eeb93 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>
2000-06-16 15:25:41 +00:00
Bodo Möller
f03aa651c0 typo 2000-06-16 14:35:05 +00:00
Bodo Möller
5d07c20d8e In EVP_BytesToKey, replace explicit "8" by "PKCS5_SALT_LEN". 2000-06-16 14:29:51 +00:00
Bodo Möller
4ee1eb7bd4 There are compilers that complain if a variable has the same name as a
label. (Reported by Alexei Bakharevski.)
2000-06-16 14:24:37 +00:00
Geoff Thorpe
e9a68cfbc3 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).
2000-06-16 10:45:36 +00:00
Dr. Stephen Henson
d3ed8ceb3d Add support for the modified SGC key format used in IIS. 2000-06-15 23:48:05 +00:00
Richard Levitte
f20ee31477 Make sure that bs is not getting free'd again.
Reported by Robert Eiglmaier <robert.eiglmaier@ixos.de>
2000-06-15 11:10:15 +00:00
Bodo Möller
24bec03beb This probably fixes a BN_rshift bug. 2000-06-13 15:07:39 +00:00
Bodo Möller
c3b1424cc0 Use BN_CTX_end when exiting early from BN_mod_exp_mont_word because
BN_mod_exp_atalla could be used.
2000-06-13 13:50:42 +00:00
Geoff Thorpe
8ba6d1b0cc The atalla functionality doesn't work with the "word" version of
BN_mod_exp. Call the regular atalla mod_exp operation instead.
2000-06-13 13:18:51 +00:00
Geoff Thorpe
1c4f90a05d 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.
2000-06-13 12:59:38 +00:00
Ulf Möller
44317f04b1 protoypes 2000-06-12 19:45:38 +00:00
Dr. Stephen Henson
e366f2b876 Fix evp_locl.h macros.
Documentation correction.
2000-06-11 15:43:17 +00:00
Dr. Stephen Henson
fd75eb50c0 Make EVP_SealInit() and EVP_OpenInit() check EVP_EncryptInit() and
EVP_DecryptInit() return values.

Update docs.
2000-06-11 12:27:58 +00:00
Dr. Stephen Henson
a91dedca48 Document EVP routines. Change EVP_SealInit() and EVP_OpenInit()
to support multiple calls.

New function to retrieve email address from certificates and
requests.
2000-06-11 12:18:15 +00:00
Richard Levitte
ef33b97050 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.
2000-06-09 10:41:35 +00:00
Bodo Möller
814ed26cfa Comment for increased code clarity. 2000-06-09 09:11:30 +00:00
Bodo Möller
3dd985ee2a Harmonize indentation. 2000-06-08 22:41:03 +00:00
Bodo Möller
dc434bbcb0 Slightly faster DSA verification (BN_mod_exp2_mont),
marginally faster BN_mod_exp for 1024 bit exponents.
2000-06-08 20:26:03 +00:00
Bodo Möller
f8989a2155 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.)
2000-06-08 09:39:28 +00:00
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