Commit Graph

1486 Commits

Author SHA1 Message Date
Bodo Möller
cd56182b41 Change prototypes for new CRYPTO_..._mem_ex_functions functions so
that they match the function definitions (namely, remove file/line
parameters from free_func).
2001-01-10 14:10:17 +00:00
Richard Levitte
65a22e8e4d As response to a user request to be able to use external memory
handling routines that need file name and line number information,
I've added a call level to our memory handling routines to allow that
kind of hooking.
2001-01-10 13:14:58 +00:00
Dr. Stephen Henson
cbf0f45f90 Fix uni2asc() so it can properly convert zero length
unicode strings. Certain PKCS#12 files contain these
in BMPStrings and it used to crash on them.
2001-01-10 01:06:31 +00:00
Geoff Thorpe
04e53c273f oops, void functions shouldn't try and return a value. Strangely, gcc
didn't even give a warning for this yet HPUX cc considered it an error.
Reported by Lutz(@openssl.org).
2001-01-09 16:59:56 +00:00
Lutz Jänicke
599c03530a Add automatic query of EGD sockets to RAND_poll(). The EGD sockets are
only queried when the /dev/[u]random devices did not return enough
entropy. Only the amount of entropy missing to reach the required minimum
is queried, as EGD may be drained.
Queried locations are: /etc/entropy, /var/run/egd-pool
2001-01-09 16:44:59 +00:00
Lutz Jänicke
28e5428d5d Don't cheat: when only getting several bytes from each source, n is incremented
correctly, but RAND_add(..,n) counts the increasing n several times.
Only RAND_add(..,n) once entropy collection is finished.
2001-01-09 10:58:36 +00:00
Geoff Thorpe
3c91484052 Move all the existing function pointer casts associated with LHASH's two
"doall" functions to using type-safe wrappers. As and where required, this
can be replaced by redeclaring the underlying callbacks to use the
underlying "void"-based prototypes (eg. if performance suffers from an
extra level of function invocation).
2001-01-09 00:24:38 +00:00
Geoff Thorpe
98d517c5da Get rid of the function pointer casting in the debugging memory code due
to LHASH usage. NB: The callback type used as been suctioned off into
crypto.h as CRYPTO_MEM_LEAK_CB to improve clarity.
2001-01-09 00:13:25 +00:00
Geoff Thorpe
18602745de This adds macros to implement (and/or declare) type-safe wrapper functions
around the callbacks required in the LHASH code for the "doall" functions.

Also - fix the evil function pointer casting in the two lh_doall functions
by deferring to a static utility function. Previously lh_doall() was
invoking lh_doall_arg() by casting the callback to the 2-parameter
prototype and passing in a NULL argument. This appears to have been working
thus far but it's not a hot idea. If the extra level of indirection becomes
a performance hit, we can just provide two virtually identical
implementations for each variant later on.
2001-01-09 00:02:09 +00:00
Geoff Thorpe
ad2e032049 Whilst in the process of fixing outstanding function-pointer casts in the
LHASH code, this evil was uncovered. The cast was obscuring the fact that
the function was prototyped to take 2 parameters when in fact it is being
used as a callback that should take only one. Anyway, the function itself
ignores the second parameter (thankfully). A proper cure is on the way but
for now this corrects the inconsistency.
2001-01-08 22:03:27 +00:00
Richard Levitte
601140b363 Keep up with Unix code. It's beginning to be time to rethink the VMS
build system...
2001-01-08 21:32:46 +00:00
Dr. Stephen Henson
b5524a3ac3 Add prototypes for new OCSP functions.
Fix bug in OCSP_find_status().
2001-01-08 13:39:06 +00:00
Richard Levitte
0c61e299b3 Change RAND_poll for Unix to try a number of devices and only read
them for a short period of time (actually, poll them with select(),
then read() whatever is there), which is about 10ms (hard-coded value)
each.

Separate Windows and Unixly code, and start on a VMS variant that
currently just returns 0.
2001-01-08 10:59:26 +00:00
Dr. Stephen Henson
0b33bc65cd Add set of OCSP client functions. All experimental
and subject to addition, modifcation or deletion.

Add two OCSP nonce utility functions.

Fix typo in status code name.
2001-01-08 01:21:55 +00:00
Richard Levitte
0f5fa24a7c Keep up with the Unixly changes. 2001-01-07 18:51:28 +00:00
Dr. Stephen Henson
8e96183506 Modify OCSP API to more closely reflect
application needs.

Add OCSP library name to error code.
2001-01-05 03:31:51 +00:00
Dr. Stephen Henson
a8312c0e24 Fix typo in OCSP nonce extension.
Set correct type in ASN1_STRING for
INTEGER and ENUMERATED types.

Make ASN1_INTEGER_get() and ASN1_ENUMERATED_get()
return -1 for invalid type rather than 0 (which is
often valid). -1 may also be valid but this is less
likely.

Load OCSP error strings in ERR_load_crypto_strings().
2001-01-04 19:53:48 +00:00
Dr. Stephen Henson
bf0d176e48 Update OCSP API.
Remove extensions argument from various functions
because it is not needed with the new extension
code.

New function OCSP_cert_to_id() to convert a pair
of certificates into an OCSP_CERTID.

New simple OCSP HTTP function. This is rather primitive
but just about adequate to send OCSP requests and
parse the response.

Fix typo in CRL distribution points extension.

Fix ASN1 code so it adds a final null to constructed
strings.
2001-01-04 01:46:36 +00:00
Dr. Stephen Henson
ec5add8784 Fix the S/MIME code so it now works again and
uses the new ASN1 code.
2000-12-31 17:31:57 +00:00
Richard Levitte
856d456a71 Make the DSO code for VMS work again. First attempt. 2000-12-31 01:55:46 +00:00
Richard Levitte
e102a3dcfd Since asn1.h gets included recursively from many places, the easiest
is to have asn1.h include e_os.h and e_os2.h.  Of course, this makes
the unofficial "non-export" status of e_os.h a bit delicate...
2000-12-31 01:18:50 +00:00
Dr. Stephen Henson
ecbe07817a Rewrite PKCS#12 code and remove some of the old
horrible macros.

Fix two evil ASN1 bugs. Attempt to use 'ctx' when
NULL if input is indefinite length constructed
in asn1_check_tlen() and invalid pointer to ASN1_TYPE
when reusing existing structure (this took *ages* to
find because the new PKCS#12 code triggered it).
2000-12-31 01:13:04 +00:00
Richard Levitte
26da3e65ac If OPENSSL_BUILD_SHLIBCRYPTO (for files that end up as libcrypto
objects) or OPENSSL_BUILD_SHLIBSSL (for files that end up as libssl
objects) is defined, redefine OPENSSL_EXTERN to be OPENSSL_EXPORT.
This is actually only important on Win32, and can safely be ignored in
all other cases, at least for now.
2000-12-31 00:23:17 +00:00
Dr. Stephen Henson
d8ecc56c9d Delete PKCS#12 redundant files. 2000-12-30 12:26:33 +00:00
Dr. Stephen Henson
4e1209ebf8 ASN1_ITEM versions of ASN1_d2i_{fp, bio} and replacement of
most of the old wrappers. A few of the old versions remain
because they are non standard and the corresponding ASN1
code has not been reimplemented yet.
2000-12-30 02:40:26 +00:00
Dr. Stephen Henson
78d3b819f0 Replace the old ASN1_dup() with ASN1_item_dup() and
zap some evil function pointers casts along the way...
2000-12-29 18:23:55 +00:00
Richard Levitte
1690c2b26e Correct a typo. 2000-12-29 01:41:37 +00:00
Richard Levitte
701adceb12 "make update" plus a rewrite of both .num files. 2000-12-29 00:19:12 +00:00
Dr. Stephen Henson
f86c5c9ac7 ASN1_ITEM version of ASN1_dup(). Might want
something more efficient later...
2000-12-28 22:41:46 +00:00
Richard Levitte
66a0def81b Update VMS build procedures to match the current status. 2000-12-28 22:26:11 +00:00
Dr. Stephen Henson
73e92de577 Add NO_ASN1_OLD to remove some old style functions:
currently OpenSSL itself wont compile with this set
because some old style stuff remains.

Change old functions X509_sign(), X509_verify() etc
to use new item based functions.

Replace OCSP function declarations with DECLARE macros.
2000-12-28 22:24:50 +00:00
Dr. Stephen Henson
09ab755c55 ASN1_ITEM versions of sign, verify, pack and unpack.
The old function pointer versions will eventually go
away.
2000-12-28 19:18:48 +00:00
Dr. Stephen Henson
ec558b6548 New OCSP extension functions. 2000-12-28 01:05:05 +00:00
Dr. Stephen Henson
29e1fdf3f2 Avoid compiler warnings in hw_ubsec.c: unused static
functions and signed/unsigned mismatch.

This will of course change if some of the unused functions
suddenly get used...
2000-12-27 19:20:14 +00:00
Dr. Stephen Henson
28ddfc61dc X509V3_add_i2d() needs to be able to allocate a
STACK_OF(X509_EXTENSION) so it should be passed
STACK_OF(X509_EXTENSION) ** in the first argument.

Modify wrappers appropriately.
2000-12-27 13:42:43 +00:00
Dr. Stephen Henson
57d2f21782 New function X509V3_add_i2d() this is used for
encoding, replacing and deleting extensions.

Fix X509V3_get_d2i() so it uses takes note of
new critical behaviour.
2000-12-24 18:02:33 +00:00
Dr. Stephen Henson
3c07b4c2ee Various Win32 related fixes. Doesn't compile yet on
Win32 but it is getting there...

Update mkdef.pl to handle ASN1_ANY and fix headers.

Stop various VC++ warnings.

Include some fixes from "Peter 'Luna' Runestig"
<peter@runestig.com>

Remove external declaration for des_set_weak_key_flag:
it doesn't exist.
2000-12-21 01:38:55 +00:00
Bodo Möller
60f7492646 Don't access non-existing element buf[256], use buf[255] instead.
Submitted by: draslar <draslar@elray.ch>
2000-12-20 10:11:06 +00:00
Dr. Stephen Henson
5755cab49d Fixes to OCSP print code.
Don't try to print request certificates if signature is not present.

Remove unnecessary test for certificates being NULL.

Fix typos in printed output.

Tidy up output.

Fix for typo in OCSP_SERVICELOC ASN1 template.

Also give a bit more info in CHANGES about the ASN1 revision.
2000-12-20 00:46:44 +00:00
Bodo Möller
975842f9fb fix indentation 2000-12-19 12:39:45 +00:00
Bodo Möller
126fe085db Don't hold CRYPTO_LOCK_RSA during time-consuming operations. 2000-12-19 12:31:41 +00:00
Bodo Möller
123d24d600 Add a comment (intended change) 2000-12-18 16:39:00 +00:00
Bodo Möller
cb38052b3a Comment correction. 2000-12-18 09:18:22 +00:00
Bodo Möller
f640ee90c3 Obtain lock CRYPTO_LOCK_RSA before creating BN_MONT_CTX
structures and setting rsa->_method_mod_{n,p,q}.

Submitted by: "Reddie, Steven" <Steven.Reddie@ca.com>
2000-12-18 09:00:48 +00:00
Dr. Stephen Henson
1f47ec53a2 Redo OCSP response printing. Remove duplicate or
obsolete code. Delete some redundant files.
2000-12-17 14:09:43 +00:00
Bodo Möller
b2e7419a1d Simplify preprocessor statements. 2000-12-17 00:30:03 +00:00
Dr. Stephen Henson
6546fdfaf8 Add OCSP service locator extension. 2000-12-16 12:51:58 +00:00
Richard Levitte
3a3ca1d474 Do not poll DEVRANDOM if weäre building without an file pointer API.
Spotted by "David Schwartz" <davids@webmaster.com>.
2000-12-16 11:19:19 +00:00
Dr. Stephen Henson
f1a6a0d4dd Add support for the noCheck OCSP extension. This is
just a NULL and appears in a certificate.
2000-12-16 01:58:58 +00:00
Bodo Möller
3ac82faae5 Locking issues. 2000-12-15 16:40:35 +00:00