Encryption BIOs misbehave when used with non blocking I/O.
Two fixes:
1. If BIO_write() fails inside enc_write() it should return the
total number of bytes successfully written.
2. If BIO_write() fails during BIO_flush() it should return immediately
with the error code: previously it would fall through to the final
encrypt, corrupting the buffer.
Base64 bio fixes. The base64 bio was seriously broken
when reading from a non blocking BIO.
It would incorrectly interpret retries as EOF, incorrectly
buffer initial data and have no buffering at all after initial
data (data would be sent one byte at a time to EVP_DecodeUpdate).
Bodo Möller [Fri, 21 Feb 2003 13:58:23 +0000 (13:58 +0000)]
ECPublicKey_set_octet_string and ECPublicKey_get_octet_string
behaviour was not quite consistent with the conventions
for d2i and i2d functions as far as handling of the 'out'
or 'in' pointer is concerned.
This patch changes this behaviour, and renames the functions to
o2i_ECPublicKey and i2o_ECPublicKey (not 'd2i' and 'i2d' because the
external encoding is just a raw object string without any DER icing).
Fix bug in base64 bios during write an non blocking I/O:
if the write fails when flushing the buffer return the
value to the application so it can retry.
Geoff Thorpe [Sat, 15 Feb 2003 00:18:38 +0000 (00:18 +0000)]
We cache a montgomery form for 'n' if the PUBLIC flag is set, not PRIVATE.
Also, I've added handling for other mod_exp calls that were not using any
cached montgomery forms. These cases matter only for special RSA keys (eg.
ones that are missing information) so are unlikely to be used in normal
circumstances.
Geoff Thorpe [Fri, 14 Feb 2003 23:21:19 +0000 (23:21 +0000)]
David Brumley <dbrumley@stanford.edu> noted and corrected a case in the
verification step of CRT private key operations in the RSA code -
previously no montgomery form was checked or used for 'n', and so it would
be generated on the fly each time. As a result, private key operations are
now a percent or two faster.
Rather than adding this as another repetition of the nearly-identical
montgomery "check for first-use" initialisation code blocks, I've taken
this chance to create a helper function and macro-wrapper to replace them.
Richard Levitte [Fri, 14 Feb 2003 08:56:21 +0000 (08:56 +0000)]
Update linux-mips and linux-mipsel to support threads and shared libraries.
I also updated the bn_ops field with values taken from OpenBSD-mips.
PR: 498
Richard Levitte [Thu, 13 Feb 2003 23:52:54 +0000 (23:52 +0000)]
Add full support for -rpath/-R, both in shared libraries and
applications, at least on the platforms where it's known how
to do it.
Note: this has only been tested on GNU-based platforms (Linux), and
needs to be tested on all others. Additionally, it's not yet
supported on the following platforms, for lack of information:
Darwin (MacOS X)
Cygwin
OSF1/Alpha
SVR3
ReliantUNIX
Please help out with testing and the platforms we don't yet know well
enough.
Bodo Möller [Wed, 12 Feb 2003 18:30:16 +0000 (18:30 +0000)]
Allow EC_GROUP objects to share precomputation for improved memory
efficiency (EC_PRE_COMP objects are now constant once completed).
Extend 'extra_data' API to support arbitrarily many slots (although we
need only one at the moment).
Modify EC internal 'extra_data' API: EC_GROUP_[clear_]free_extra_data
now frees only a single slot (the previous functions are available as
EC_GROUP_[clear_]free_all_extra_data).
Submitted by: Nils Larsch
Reviewed by: Bodo Moeller
Richard Levitte [Wed, 12 Feb 2003 17:20:39 +0000 (17:20 +0000)]
Adjust DES_cbc_cksum() so the returned value is the same as MIT's
mit_des_cbc_cksum(). The difference was first observed, then verified by
looking at the MIT source.
Richard Levitte [Fri, 31 Jan 2003 12:20:35 +0000 (12:20 +0000)]
We can't say in advance what the argument to BIO_socket_ioctl() should be, so
let's make that a void *. Also, BIO_socket_nbio() should send it an int
argument, not a long.
PR: 457
Richard Levitte [Thu, 30 Jan 2003 18:52:46 +0000 (18:52 +0000)]
The OPENSSL_NO_ENGINE has small problem: it changes certain structures. That's
bad, so let's not check OPENSSL_NO_ENGINE in those places. Fortunately, all
the header files where the problem existed include ossl_typ.h, which makes
a 'forward declaration' of the ENGINE type.
Geoff Thorpe [Thu, 30 Jan 2003 15:49:03 +0000 (15:49 +0000)]
This glues the GMP wrapper ENGINE into OpenSSL if it is being built (ie. if
the OPENSSL_USE_GMP symbol is defined). Also, I've re-ordered the listing
of other builtin ENGINEs to be alphabetical (though "dynamic" will still
come first).
Geoff Thorpe [Thu, 30 Jan 2003 15:43:07 +0000 (15:43 +0000)]
Commit a slightly modified version of an old experiment to do RSA private
key operations using the GMP library. The default is not to build (or use)
this code unless OPENSSL_USE_GMP is defined (because it will impose header
and linker dependencies that might need specifying too).
Geoff Thorpe [Thu, 30 Jan 2003 14:58:44 +0000 (14:58 +0000)]
"openssl engine" will not display ENGINE/DSO load failure errors when
testing availability of engines with "-t" - the old behaviour of is
produced by increasing the feature's verbosity with "-tt".
Richard Levitte [Wed, 29 Jan 2003 15:06:35 +0000 (15:06 +0000)]
DVCS (see RFC 3029) was missing among the possible purposes.
Notified privately to me by Peter Sylvester <Peter.Sylvester@EdelWeb.fr>,
one of the authors of said RFC