Richard Levitte [Thu, 12 Dec 2002 22:12:02 +0000 (22:12 +0000)]
BIO_new_bio_pair() was unnecessarily described in it's own page as well as in
BIO_s_bio.pod. The most logical is to move everything needed from
BIO_new_bio_pair.pod to BIO_s_bio.pod (including the nice example)
and toss BIO_new_bio_pair.pod. I hope I got all the info over properly.
PR: 370
Richard Levitte [Wed, 11 Dec 2002 08:33:31 +0000 (08:33 +0000)]
sk_*_push() returns the number of items on the stack, not the index of the
pushed item. The index is the number of items - 1. And if a NULL item was
found, actually use it.
Finally, provide a little bit of safety in CRYPTO_lock() by asserting the a
requested dynamic lock really must exist, instead of just being silent about it
Richard Levitte [Wed, 11 Dec 2002 06:59:16 +0000 (06:59 +0000)]
Since HEADER_DES_H has been the protector of des.h since libdes
(before SSLeay, maybe?), it's better to have that macro protect
the compatibility header des_old.h. In the new des.h, let's use
a slightly different protecting macro.
The rationale is that there are application that might include (via
other header files, perhaps) both an old libdes des.h and OpenSSL's
des.h. Whichever comes first would overshadow the other because of
the clash in protecting macro. This fix solves that problem.
Richard Levitte [Mon, 9 Dec 2002 02:18:16 +0000 (02:18 +0000)]
Hmm, Geoff's change made things quite interesting. We can now give
users the option of disabling deprecated functions, which should of
course be reflected in libeay.num and .def files. Quite nice,
actually.
Geoff Thorpe [Sun, 8 Dec 2002 16:45:26 +0000 (16:45 +0000)]
Nils Larsch submitted;
- a patch to fix a memory leak in rsa_gen.c
- a note about compiler warnings with unions
- a note about improving structure element names
This applies his patch and implements a solution to the notes.
Geoff Thorpe [Sun, 8 Dec 2002 05:38:44 +0000 (05:38 +0000)]
Undefine OPENSSL_NO_DEPRECATED inside openssl application code if we are
being built with it defined - it is not a symbol to affect how openssl
itself builds, but to alter the way openssl headers can be used from an API
point of view. The "deprecated" function wrappers will always remain inside
OpenSSL at least as long as they're still being used internally. :-)
The exception is dsaparam which has been updated to the BN_GENCB-based
functions to test the new functionality. If GENCB_TEST is defined, dsaparam
will support a "-timebomb <n>" switch to cancel parameter-generation if it
gets as far as 'n' seconds without completion.
Geoff Thorpe [Sun, 8 Dec 2002 05:24:31 +0000 (05:24 +0000)]
This is a first-cut at improving the callback mechanisms used in
key-generation and prime-checking functions. Rather than explicitly passing
callback functions and caller-defined context data for the callbacks, a new
structure BN_GENCB is defined that encapsulates this; a pointer to the
structure is passed to all such functions instead.
This wrapper structure allows the encapsulation of "old" and "new" style
callbacks - "new" callbacks return a boolean result on the understanding
that returning FALSE should terminate keygen/primality processing. The
BN_GENCB abstraction will allow future callback modifications without
needing to break binary compatibility nor change the API function
prototypes. The new API functions have been given names ending in "_ex" and
the old functions are implemented as wrappers to the new ones. The
OPENSSL_NO_DEPRECATED symbol has been introduced so that, if defined,
declaration of the older functions will be skipped. NB: Some
openssl-internal code will stick with the older callbacks for now, so
appropriate "#undef" logic will be put in place - this is in case the user
is *building* openssl (rather than *including* its headers) with this
symbol defined.
There is another change in the new _ex functions; the key-generation
functions do not return key structures but operate on structures passed by
the caller, the return value is a boolean. This will allow for a smoother
transition to having key-generation as "virtual function" in the various
***_METHOD tables.
Bodo Möller [Wed, 4 Dec 2002 17:43:01 +0000 (17:43 +0000)]
In ECPKParameters_print, output the private key length correctly
(length of the order of the group, not length of the actual key, which
will be shorter in some cases).
Richard Levitte [Tue, 3 Dec 2002 16:33:03 +0000 (16:33 +0000)]
EXIT() may mean return(). That's confusing, so let's have it really mean
exit() in whatever way works for the intended platform, and define
OPENSSL_EXIT() to have the old meaning (the name is of course because
it's only used in the openssl program)
Richard Levitte [Mon, 2 Dec 2002 21:31:45 +0000 (21:31 +0000)]
I think I got it now. Apparently, the case of having to shift down
the divisor was a bit more complex than I first saw. The lost bit
can't just be discarded, as there are cases where it is important.
For example, look at dividing 320000 with 80000 vs. 80001 (all
decimals), the difference is crucial. The trick here is to check if
that lost bit was 1, and in that case, do the following:
1. subtract the quotient from the remainder
2. as long as the remainder is negative, add the divisor (the whole
divisor, not the shofted down copy) to it, and decrease the
quotient by one.
There's probably a nice mathematical proof for this already, but I
won't bother with that, unless someone requests it from me.
Richard Levitte [Fri, 29 Nov 2002 11:30:45 +0000 (11:30 +0000)]
A few more memset()s converted to OPENSSL_cleanse().
I *think* I got them all covered by now, bu please, if you find any more,
tell me and I'll correct it.
PR: 343
Richard Levitte [Tue, 26 Nov 2002 11:14:32 +0000 (11:14 +0000)]
The logic in the main signing and verifying functions to check lengths was
incorrect. Fortunately, there is a second check that's correct, when adding
the pads.
PR: 355
Lutz Jänicke [Wed, 20 Nov 2002 10:48:58 +0000 (10:48 +0000)]
Fix bug introduced by the attempt to fix client side external session
caching (#288): now internal caching failed (#351):
Make sure, that cipher_id is set before comparing.
Submitted by:
Reviewed by:
PR: 288 (and 351)