oweals/openssl.git
8 years agoAdd a comment to 90-test_external.t to explain why we need filter_run
Matt Caswell [Fri, 14 Oct 2016 14:55:49 +0000 (15:55 +0100)]
Add a comment to 90-test_external.t to explain why we need filter_run

Also rename executable to cmd...otherwise it breaks!

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoConvert 90-test_external.t to using "executable" rather than "system"
Richard Levitte [Fri, 14 Oct 2016 14:52:50 +0000 (15:52 +0100)]
Convert 90-test_external.t to using "executable" rather than "system"

Use the newly added "executable" function rather than "system". Also filter
the output to add a prefix to every line so that the "ok" doesn't confuse
Test::More

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoControl building of ossl_shim through Configure
Matt Caswell [Wed, 12 Oct 2016 15:21:13 +0000 (16:21 +0100)]
Control building of ossl_shim through Configure

Don't build ossl_shim by default. Switch it on through
enable-external-tests.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoIntegrate ossl_shim into the build
Richard Levitte [Wed, 12 Oct 2016 15:05:06 +0000 (16:05 +0100)]
Integrate ossl_shim into the build

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAdd a shim config file
Matt Caswell [Wed, 12 Oct 2016 14:43:46 +0000 (15:43 +0100)]
Add a shim config file

This just disables all tests that fail at the moment. Over time we will
want to go over these and figure out why they are failing (and fix them if
appropriate)

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd ossl_shim to .gitignore
Matt Caswell [Wed, 12 Oct 2016 11:07:33 +0000 (12:07 +0100)]
Add ossl_shim to .gitignore

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRebase shim against latest boringssl code
Matt Caswell [Wed, 12 Oct 2016 09:56:29 +0000 (10:56 +0100)]
Rebase shim against latest boringssl code

Numerous conflicts resolved. rebase was against commit 490469f850.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd a test to call the BoringSSL test suite
Matt Caswell [Mon, 10 Oct 2016 11:24:00 +0000 (12:24 +0100)]
Add a test to call the BoringSSL test suite

This adds a test to the OpenSSL test suite to invoke the BoringSSL test
suite.

It assumes you have already compiled the ossl_shim (see previous commit).
It also assumes that you have an environment variable BORING_RUNNER_DIR
set up to point to the ssl/test/runner directory of a checkout of BoringSSL.

This has only been tested with a very old version of BoringSSL (from commit
f277add6c) - since that was the last known checkout where the shim compiles
successfully. Even with that version of BoringSSL this test will fail. There
are lots of Boring tests that are failing for various reasons. Some might
be due to bugs in OpenSSL, some might be due to features that BoringSSL has
that OpenSSL doesn't, some are due to assumptions about the way BoringSSL
behaves that are not true for OpenSSL etc.

To get the verbose BoringSSL test output, run like this:

VERBOSE=1 BORING_RUNNER_DIR=/path/to/boring/ssl/test/runner make \
TESTS="test_external" test

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoIntegrate BoringSSL shim
Matt Caswell [Mon, 10 Oct 2016 11:17:21 +0000 (12:17 +0100)]
Integrate BoringSSL shim

The BoringSSL test suite contains numerous tests which OpenSSL does not.

The BoringSSL test runner uses a shim to launch the library and execute the
tests. This is a version of the BoringSSL shim converted to compile against
OpenSSL instead.

This is primarily based on the work of David Benjamin from the BoringSSL
project who did most of the necessary conversion. It also includes a few
other tweaks for opacity changes etc.

This is based on a *very* old version of BoringSSL from commit f277add6c.
That was the last commit known to work with this patched shim. Later
versions may also work but lots of merge conflicts occur when trying to
bring it up to date.

At the moment this has not been integrated into the build system. There is
a very simple standalone makefile in the ossl_shim directory which should
be executed directly before tyring to use the shim.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoDon't assume to know the shared library extension
Richard Levitte [Thu, 3 Nov 2016 17:48:23 +0000 (18:48 +0100)]
Don't assume to know the shared library extension

test/shlibloadtest.c assumes all Unix style platforms use .so as
shared library extension.  This is not the case for Mac OS X, which
uses .dylib.  Instead of this, have the test recipe find out the
extension from configuration data.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1844)

8 years agoUpdate CRYPTO_set_mem_debug() doc
Rich Salz [Thu, 3 Nov 2016 17:16:26 +0000 (13:16 -0400)]
Update CRYPTO_set_mem_debug() doc

Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1842)

8 years agoEnable memory debugging while testing
Richard Levitte [Thu, 3 Nov 2016 16:08:10 +0000 (17:08 +0100)]
Enable memory debugging while testing

Pre 1.1.0, 'make test' would set the environment variable
OPENSSL_DEBUG_MEMORY to "on".  This got lost when translating the old
build files to the new templates.  This changes reintroduces that
variable.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1840)

8 years agotest/shlibloadtest: small fixes
Richard Levitte [Thu, 3 Nov 2016 15:21:36 +0000 (16:21 +0100)]
test/shlibloadtest: small fixes

- Make sure to initialise SHLIB variables
- Make sure to make local variables static

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1838)

8 years agoClang doesn't like -znodelete, make it a linker flag instead
Richard Levitte [Thu, 3 Nov 2016 14:26:00 +0000 (15:26 +0100)]
Clang doesn't like -znodelete, make it a linker flag instead

gcc is kinder, it silently passes quite a few flags to ld, while clang
is stricter and wants them prefixed with -Wl,

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1836)

8 years agoClean away remaining 'selftest' code
Richard Levitte [Fri, 28 Oct 2016 19:41:12 +0000 (21:41 +0200)]
Clean away remaining 'selftest' code

All of these don't compile cleanly any more, probably haven't for quite
some time

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoFinally, add a test recipe for the internal tests
Richard Levitte [Thu, 27 Oct 2016 21:25:09 +0000 (23:25 +0200)]
Finally, add a test recipe for the internal tests

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoConvert mdc2 test print to internal test
Richard Levitte [Thu, 27 Oct 2016 20:18:50 +0000 (22:18 +0200)]
Convert mdc2 test print to internal test

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoConvert x509 selftests to internal test
Richard Levitte [Thu, 27 Oct 2016 19:42:45 +0000 (21:42 +0200)]
Convert x509 selftests to internal test

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoAdd a HEADER_MODES_H guard in include/openssl/modes.h
Richard Levitte [Thu, 27 Oct 2016 23:32:33 +0000 (01:32 +0200)]
Add a HEADER_MODES_H guard in include/openssl/modes.h

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoConvert modes selftests (cts128 and gcm128) to internal test
Richard Levitte [Thu, 27 Oct 2016 17:57:41 +0000 (19:57 +0200)]
Convert modes selftests (cts128 and gcm128) to internal test

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoConvert asn1 selftests (a_strnid and ameth_lib) into internal test
Richard Levitte [Wed, 26 Oct 2016 21:12:48 +0000 (23:12 +0200)]
Convert asn1 selftests (a_strnid and ameth_lib) into internal test

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoVMS: ignore multiply defined symbols when linking programs
Richard Levitte [Wed, 26 Oct 2016 20:31:29 +0000 (22:31 +0200)]
VMS: ignore multiply defined symbols when linking programs

The Unix and Windows linkers appear to simply ignore if any symbol is
defined multiple times in different object files and libraries.

The VMS linker, on the other hand, warns about it, loud and clear.  It
will still create the executable, but does so screaming.  So we
complicate things by saving the linker output, look through all the
errors and warnings, and if they are only made up of %LINK-W-MULDEF,
we let it pass, otherwise we output the linker output and raise the
same exit code we got from the linker.

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoExplain the deal with internal test programs
Richard Levitte [Thu, 27 Oct 2016 06:44:36 +0000 (08:44 +0200)]
Explain the deal with internal test programs

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoAllow indented comments in build.info
Richard Levitte [Tue, 25 Oct 2016 10:40:32 +0000 (12:40 +0200)]
Allow indented comments in build.info

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agoConvert poly1305 selftest into internal test
Richard Levitte [Tue, 25 Oct 2016 22:25:44 +0000 (00:25 +0200)]
Convert poly1305 selftest into internal test

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1789)

8 years agotest/build.info: typo, $ missing
Richard Levitte [Thu, 3 Nov 2016 10:31:12 +0000 (11:31 +0100)]
test/build.info: typo, $ missing

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1832)

8 years agoconf fuzzer: also check for an empty file
Kurt Roeckx [Wed, 2 Nov 2016 19:45:46 +0000 (20:45 +0100)]
conf fuzzer: also check for an empty file

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1828

8 years agoImplement GET_MODULE_HANDLE_EX_FLAG_PIN for windows
Matt Caswell [Fri, 28 Oct 2016 10:03:22 +0000 (11:03 +0100)]
Implement GET_MODULE_HANDLE_EX_FLAG_PIN for windows

Rather than leaking a reference, just call GetModuleHandleEx and pin the
module on Windows.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoLink using -znodelete
Matt Caswell [Tue, 18 Oct 2016 14:11:57 +0000 (15:11 +0100)]
Link using -znodelete

Instead of deliberately leaking a reference to ourselves, use nodelete
which does this more neatly. Only for Linux at the moment.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd a test to dynamically load and unload the libraries
Matt Caswell [Tue, 18 Oct 2016 13:16:35 +0000 (14:16 +0100)]
Add a test to dynamically load and unload the libraries

This should demonstrate that the atexit() handling is working properly (or
at least not crashing) on process exit.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoEnsure that libcrypto and libssl do not unload until the process exits
Matt Caswell [Tue, 18 Oct 2016 13:13:25 +0000 (14:13 +0100)]
Ensure that libcrypto and libssl do not unload until the process exits

Because we use atexit() to cleanup after ourselves, this will cause a
problem if we have been dynamically loaded and then unloaded again: the
atexit() handler may no longer be there.

Most modern atexit() implementations can handle this, however there are
still difficulties if libssl gets unloaded before libcrypto, because of
the atexit() callback that libcrypto makes to libssl.

The most robust solution seems to be to ensure that libcrypto and libssl
never unload. This is done by simply deliberately leaking a dlopen()
reference to them.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd a DSO_dsobyaddr() function
Matt Caswell [Sat, 15 Oct 2016 15:01:40 +0000 (16:01 +0100)]
Add a DSO_dsobyaddr() function

This works the same way as DSO_pathbyaddr() but instead returns a ptr to
the DSO that contains the provided symbol.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoPartial revert of 3d8b2ec42 to add back DSO_pathbyaddr
Matt Caswell [Sat, 15 Oct 2016 14:23:03 +0000 (15:23 +0100)]
Partial revert of 3d8b2ec42 to add back DSO_pathbyaddr

Commit 3d8b2ec42 removed various unused functions. However now we need to
use one of them! This commit resurrects DSO_pathbyaddr(). We're not going to
resurrect the Windows version though because what we need to achieve can be
done a different way on Windows.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd a CHANGES entry for the unrecognised record type change
Matt Caswell [Wed, 2 Nov 2016 22:23:16 +0000 (22:23 +0000)]
Add a CHANGES entry for the unrecognised record type change

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd a test for unrecognised record types
Matt Caswell [Wed, 2 Nov 2016 09:41:37 +0000 (09:41 +0000)]
Add a test for unrecognised record types

We should fail if we receive an unrecognised record type

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoFail if an unrecognised record type is received
Matt Caswell [Wed, 2 Nov 2016 09:14:51 +0000 (09:14 +0000)]
Fail if an unrecognised record type is received

TLS1.0 and TLS1.1 say you SHOULD ignore unrecognised record types, but
TLS 1.2 says you MUST send an unexpected message alert. We swap to the
TLS 1.2 behaviour for all protocol versions to prevent issues where no
progress is being made and the peer continually sends unrecognised record
types, using up resources processing them.

Issue reported by 郭志攀

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoTest recipes: remove duplicate OpenSSL::Test usage
Richard Levitte [Tue, 1 Nov 2016 14:03:38 +0000 (15:03 +0100)]
Test recipes: remove duplicate OpenSSL::Test usage

Reviewed-by: Matt Caswell <matt@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1815)

8 years agoFix link to LibFuzzer
Sergey Bronnikov [Fri, 28 Oct 2016 18:52:50 +0000 (22:52 +0400)]
Fix link to LibFuzzer

CLA: trivial
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1801)

8 years agoAdd a read_ahead test
Matt Caswell [Wed, 2 Nov 2016 10:44:15 +0000 (10:44 +0000)]
Add a read_ahead test

This test checks that read_ahead works correctly when dealing with large
records.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix read_ahead
Matt Caswell [Wed, 2 Nov 2016 10:34:12 +0000 (10:34 +0000)]
Fix read_ahead

The function ssl3_read_n() takes a parameter |clearold| which, if set,
causes any old data in the read buffer to be forgotten, and any unread data
to be moved to the start of the buffer. This is supposed to happen when we
first read the record header.

However, the data move was only taking place if there was not already
sufficient data in the buffer to satisfy the request. If read_ahead is set
then the record header could be in the buffer already from when we read the
preceding record. So with read_ahead we can get into a situation where even
though |clearold| is set, the data does not get moved to the start of the
read buffer when we read the record header. This means there is insufficient
room in the read buffer to consume the rest of the record body, resulting in
an internal error.

This commit moves the |clearold| processing to earlier in ssl3_read_n()
to ensure that it always takes place.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd documentation for DTLS_get_data_mtu()
David Woodhouse [Sun, 23 Oct 2016 16:03:56 +0000 (17:03 +0100)]
Add documentation for DTLS_get_data_mtu()

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAdd test cases for DTLS_get_data_mtu()
David Woodhouse [Wed, 12 Oct 2016 15:13:31 +0000 (16:13 +0100)]
Add test cases for DTLS_get_data_mtu()

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAdd unit test for ssl_cipher_get_overhead()
David Woodhouse [Thu, 6 Oct 2016 10:44:29 +0000 (11:44 +0100)]
Add unit test for ssl_cipher_get_overhead()

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAdd DTLS_get_data_mtu() function
David Woodhouse [Wed, 5 Oct 2016 23:44:59 +0000 (00:44 +0100)]
Add DTLS_get_data_mtu() function

We add ssl_cipher_get_overhead() as an internal function, to avoid
having too much ciphersuite-specific knowledge in DTLS_get_data_mtu()
itself. It's going to need adjustment for TLSv1.3... but then again, so
is fairly much *all* of the SSL_CIPHER handling. This bit is in the noise.

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoFix some style issues in ossltest
Matt Caswell [Tue, 1 Nov 2016 18:28:19 +0000 (18:28 +0000)]
Fix some style issues in ossltest

Based on feedback received

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoEnable TLSProxy to talk TLS1.3
Matt Caswell [Fri, 28 Oct 2016 14:57:12 +0000 (15:57 +0100)]
Enable TLSProxy to talk TLS1.3

Now that ossltest knows about a TLS1.3 cipher we can now do TLS1.3 in
TLSProxy

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake sure ossltest engine works with TLS1.3
Matt Caswell [Thu, 27 Oct 2016 17:32:36 +0000 (18:32 +0100)]
Make sure ossltest engine works with TLS1.3

This might need more changes once we do a "real" TLS1.3 ciphersuite. But it
should do for now.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoConvert a big "if" into a "switch"
Matt Caswell [Mon, 31 Oct 2016 10:00:45 +0000 (10:00 +0000)]
Convert a big "if" into a "switch"

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUpdate Configure to know about tls1_3
Matt Caswell [Sun, 30 Oct 2016 08:38:52 +0000 (08:38 +0000)]
Update Configure to know about tls1_3

Also we disable TLS1.3 by default (use enable-tls1_3 to re-enable). This is
because this is a WIP and will not be interoperable with any other TLS1.3
implementation.

Finally, we fix some tests that started failing when TLS1.3 was disabled by
default.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUse ciphersuite id when matching if we've got one
Matt Caswell [Wed, 2 Nov 2016 11:52:22 +0000 (11:52 +0000)]
Use ciphersuite id when matching if we've got one

When matching a ciphersuite if we are given an id, make sure we use it
otherwise we will match another ciphersuite which is identical except for
the TLS version.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd the SSL_METHOD for TLSv1.3 and all other base changes required
Matt Caswell [Fri, 21 Oct 2016 16:39:33 +0000 (17:39 +0100)]
Add the SSL_METHOD for TLSv1.3 and all other base changes required

Includes addition of the various options to s_server/s_client. Also adds
one of the new TLS1.3 ciphersuites.

This isn't "real" TLS1.3!! It's identical to TLS1.2 apart from the protocol
and the ciphersuite...and the ciphersuite is just a renamed TLS1.2 one (not
a "real" TLS1.3 ciphersuite).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoTEST_check macro: don't end with semi
Emilia Kasper [Tue, 1 Nov 2016 14:12:32 +0000 (15:12 +0100)]
TEST_check macro: don't end with semi

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoSecure our notification email.
Richard Levitte [Tue, 1 Nov 2016 23:09:03 +0000 (00:09 +0100)]
Secure our notification email.

Forks will have to define their own

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1821)

8 years agoAdd SSL_CTX_set1_cert_store()
Todd Short [Tue, 31 Mar 2015 20:20:03 +0000 (16:20 -0400)]
Add SSL_CTX_set1_cert_store()

For convenience, combine getting a new ref for the new SSL_CTX
with assigning the store and freeing the old one.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1755)

8 years ago[fuzzers] do not fail fuzzers with empty input
Mike Aizatsky [Wed, 26 Oct 2016 20:56:39 +0000 (13:56 -0700)]
[fuzzers] do not fail fuzzers with empty input

Reviewed-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
GH: #1788

8 years agoFix grammar-o in CONTRIBUTING
Benjamin Kaduk [Mon, 26 Sep 2016 20:30:42 +0000 (15:30 -0500)]
Fix grammar-o in CONTRIBUTING

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1625)

8 years agoRevert "Disable MDC2 by default."
Rich Salz [Tue, 1 Nov 2016 14:28:16 +0000 (10:28 -0400)]
Revert "Disable MDC2 by default."

This reverts commit ca1574cec20589885000d039eed3a9375fb29a0d.
Not suitabled for a minor release as it breaks the ABI.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoHPUX: Add the forgotten $(DSTDIR) when linking DSOs
Richard Levitte [Fri, 28 Oct 2016 21:35:37 +0000 (23:35 +0200)]
HPUX: Add the forgotten $(DSTDIR) when linking DSOs

Reviewed-by: Andy Polyakov <appro@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1802)

8 years agoUnix Makefile: Some sed implementation truncate long lines. Use perl instead.
Richard Levitte [Mon, 31 Oct 2016 16:38:36 +0000 (17:38 +0100)]
Unix Makefile: Some sed implementation truncate long lines.  Use perl instead.

Fixes #1781

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1813)

8 years agosha/keccak1600.c: add couple of soft asserts.
Andy Polyakov [Mon, 24 Oct 2016 14:05:31 +0000 (16:05 +0200)]
sha/keccak1600.c: add couple of soft asserts.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoDisable MDC2 by default.
Rich Salz [Mon, 31 Oct 2016 16:48:16 +0000 (12:48 -0400)]
Disable MDC2 by default.

Reviewed-by: Tim Hudson <tjh@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoMark VC templates correctly.
Richard Levitte [Mon, 31 Oct 2016 15:40:36 +0000 (16:40 +0100)]
Mark VC templates correctly.

VC-noCE-common and VC-WIN64-common were missing this line:

        template         => 1,

Fixes GH#1809

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1811)

8 years agoTry to unify BIO read/write parameter names
Benjamin Kaduk [Fri, 28 Oct 2016 16:53:00 +0000 (11:53 -0500)]
Try to unify BIO read/write parameter names

After the recent reworking, not everything matched up, and some
comments didn't catch up to the outl-->dlen and inl-->dlen renames
that happened during the development of the recent patches.

Try to make parameter names consistent across header, implementation,
and manual pages.

Also remove some trailing whitespace that was inadvertently introduced.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1798)

8 years agoWordsmith INSTALL
Benjamin Kaduk [Wed, 31 Aug 2016 22:06:22 +0000 (17:06 -0500)]
Wordsmith INSTALL

Make it clear that the OPENSSL_LOCAL_CONFIG_DIR settings take
precedence over the in-tree configs.

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1798)

8 years agoFix stdio build following BIO size_t work
Matt Caswell [Thu, 27 Oct 2016 11:59:26 +0000 (12:59 +0100)]
Fix stdio build following BIO size_t work

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix more shadowed variable warnings
Matt Caswell [Tue, 25 Oct 2016 23:05:25 +0000 (00:05 +0100)]
Fix more shadowed variable warnings

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix some feedback issues for BIO size_t-ify
Matt Caswell [Tue, 25 Oct 2016 12:19:59 +0000 (13:19 +0100)]
Fix some feedback issues for BIO size_t-ify

Rename some parameters; add some error codes; fix a comment; etc

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd some sanity checks for BIO_read* and BIO_gets
Matt Caswell [Fri, 21 Oct 2016 14:21:55 +0000 (15:21 +0100)]
Add some sanity checks for BIO_read* and BIO_gets

Make sure the return value isn't bigger than the buffer len

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMore parameter naming of BIO_read*/BIO_write* related functions
Matt Caswell [Fri, 21 Oct 2016 14:15:51 +0000 (15:15 +0100)]
More parameter naming of BIO_read*/BIO_write* related functions

Based on feedback received.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoTweaks based on review feedback of BIO size_t work
Matt Caswell [Fri, 21 Oct 2016 13:35:26 +0000 (14:35 +0100)]
Tweaks based on review feedback of BIO size_t work

Rename some parameters.
Also change handling of buffer sizes >INT_MAX in length.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoEnsure that BIO_read_ex() and BIO_write_ex() only return 0 or 1
Matt Caswell [Fri, 21 Oct 2016 12:07:06 +0000 (13:07 +0100)]
Ensure that BIO_read_ex() and BIO_write_ex() only return 0 or 1

They should return 0 for a failure (retryable or not), and 1 for a success.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRead up to INT_MAX when calling legacy BIO_read() implementations
Matt Caswell [Thu, 20 Oct 2016 23:09:02 +0000 (00:09 +0100)]
Read up to INT_MAX when calling legacy BIO_read() implementations

In converting a new style BIO_read() call into an old one, read
as much data as we can (INT_MAX), if the size of the buffer is
>INT_MAX.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix a shadowed variable declaration warning
Matt Caswell [Thu, 20 Oct 2016 23:00:40 +0000 (00:00 +0100)]
Fix a shadowed variable declaration warning

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix some bogus uninit variable warnings
Matt Caswell [Thu, 20 Oct 2016 23:00:19 +0000 (00:00 +0100)]
Fix some bogus uninit variable warnings

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoDocument the new BIO functions introduced as part of the size_t work
Matt Caswell [Thu, 20 Oct 2016 08:56:18 +0000 (09:56 +0100)]
Document the new BIO functions introduced as part of the size_t work

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoEnsure all BIO functions call the new style callback
Matt Caswell [Thu, 20 Oct 2016 12:48:31 +0000 (13:48 +0100)]
Ensure all BIO functions call the new style callback

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoCreate BIO_write_ex() which handles size_t arguments
Matt Caswell [Thu, 20 Oct 2016 14:18:39 +0000 (15:18 +0100)]
Create BIO_write_ex() which handles size_t arguments

Also extend BIO_METHOD to be able to supply an implementation for the new
BIO_write_ex function.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoCreate BIO_read_ex() which handles size_t arguments
Matt Caswell [Mon, 5 Sep 2016 16:26:58 +0000 (17:26 +0100)]
Create BIO_read_ex() which handles size_t arguments

Also extend BIO_METHOD to be able to supply an implementation for the new
BIO_read function.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix a double free in ca command line
Matt Caswell [Mon, 10 Oct 2016 15:53:11 +0000 (16:53 +0100)]
Fix a double free in ca command line

Providing a spkac file with no default section causes a double free.

Thanks to Brian Carpenter for reporting this issue.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoAdd a test for BIO_read() returning 0 in SSL_read() (and also for write)
Matt Caswell [Thu, 27 Oct 2016 12:46:57 +0000 (13:46 +0100)]
Add a test for BIO_read() returning 0 in SSL_read() (and also for write)

A BIO_read() 0 return indicates that a failure occurred that may be
retryable. An SSL_read() 0 return indicates a non-retryable failure. Check
that if BIO_read() returns 0, SSL_read() returns <0. Same for SSL_write().

The asyncio test filter BIO already returns 0 on a retryable failure so we
build on that.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoA zero return from BIO_read()/BIO_write() could be retryable
Matt Caswell [Fri, 21 Oct 2016 12:25:19 +0000 (13:25 +0100)]
A zero return from BIO_read()/BIO_write() could be retryable

A zero return from BIO_read()/BIO_write() could mean that an IO operation
is retryable. A zero return from SSL_read()/SSL_write() means that the
connection has been closed down (either cleanly or not). Therefore we
should not propagate a zero return value from BIO_read()/BIO_write() back
up the stack to SSL_read()/SSL_write(). This could result in a retryable
failure being treated as fatal.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoProvide a cross-platform format specifier (OSSLzu) for printing size_t
Matt Caswell [Tue, 25 Oct 2016 14:28:30 +0000 (15:28 +0100)]
Provide a cross-platform format specifier (OSSLzu) for printing size_t

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMove manpages to man[1357] structure.
Rich Salz [Wed, 26 Oct 2016 17:56:48 +0000 (13:56 -0400)]
Move manpages to man[1357] structure.

Move manpages to manX directories
Add Windows/VMS install fix from Richard Levitte
Update README
Fix typo's
Remove some duplicates

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoVMS: tell the C compiler to use the ISO C94 standard
Richard Levitte [Wed, 26 Oct 2016 16:04:40 +0000 (18:04 +0200)]
VMS: tell the C compiler to use the ISO C94 standard

The current version of the VMS compiler provides C99 features,
strictly language wise.  Unfortunately, even the most recent standard
library isn't fully updated for that standard, so we need to use an
earlier standard that the compiler supports.

Most importantly, this affects the __STDC_VERSION__ value, which the
compiler unfortunately currently defaults to 199901L.  With this
change we won't have to give VMS special treatment when looking for
features based on that macro.

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1785)

8 years agoFix typo (reported by Matthias St. Pierre)
Rich Salz [Wed, 26 Oct 2016 15:48:43 +0000 (11:48 -0400)]
Fix typo (reported by Matthias St. Pierre)

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoBackdated note in CHANGES about shared library names
Richard Levitte [Fri, 21 Oct 2016 22:50:25 +0000 (00:50 +0200)]
Backdated note in CHANGES about shared library names

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1767)

8 years agoAdd some notes on shared library names on different platforms
Richard Levitte [Fri, 21 Oct 2016 22:49:27 +0000 (00:49 +0200)]
Add some notes on shared library names on different platforms

This is overdue since the addition of the unified build system

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1767)

8 years agoppccap.c: engage new multipplication and squaring subroutines.
Andy Polyakov [Fri, 9 Sep 2016 15:25:04 +0000 (17:25 +0200)]
ppccap.c: engage new multipplication and squaring subroutines.

[And remove FPU mutiplication subroutine.]

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agobn/asm/ppc-mont.pl: add optimized multiplication and squaring subroutines.
Andy Polyakov [Fri, 9 Sep 2016 15:19:58 +0000 (17:19 +0200)]
bn/asm/ppc-mont.pl: add optimized multiplication and squaring subroutines.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agobn/asm/ppc-mont.pl: prepare for extension.
Andy Polyakov [Fri, 9 Sep 2016 14:33:22 +0000 (16:33 +0200)]
bn/asm/ppc-mont.pl: prepare for extension.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agosha/asm/sha512-armv8.pl: adapt for kernel use.
Andy Polyakov [Tue, 11 Oct 2016 08:08:22 +0000 (10:08 +0200)]
sha/asm/sha512-armv8.pl: adapt for kernel use.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd NPN to an SSL3 build
Rich Salz [Tue, 27 Sep 2016 13:23:24 +0000 (09:23 -0400)]
Add NPN to an SSL3 build

Reviewed-by: Emilia Käsper <emilia@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1629)

8 years agox86_64 assembly pack: add Goldmont performance results.
Andy Polyakov [Fri, 14 Oct 2016 11:25:06 +0000 (13:25 +0200)]
x86_64 assembly pack: add Goldmont performance results.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agosha/keccak1600.c: add known answer and verify result with memcmp.
Andy Polyakov [Fri, 14 Oct 2016 15:19:28 +0000 (17:19 +0200)]
sha/keccak1600.c: add known answer and verify result with memcmp.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agocrypto/sha: add Keccak1600 primitives to build SHA-3 upon.
Andy Polyakov [Wed, 12 Oct 2016 13:47:45 +0000 (15:47 +0200)]
crypto/sha: add Keccak1600 primitives to build SHA-3 upon.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd a github pull request template
Kurt Roeckx [Sat, 22 Oct 2016 11:55:59 +0000 (13:55 +0200)]
Add a github pull request template

Reviewed-by: Richard Levitte <levitte@openssl.org>
GH: #1770

8 years agoFix support for DragonFly BSD
jrmarino [Fri, 21 Oct 2016 13:48:31 +0000 (08:48 -0500)]
Fix support for DragonFly BSD

The __DragonFly__ macros were introduced in issue #1546 along with a
function naming fix, but it was decided they should be handled
separately.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1765)

8 years agoEfence is antiquated, remove all traces of using it
Richard Levitte [Fri, 21 Oct 2016 23:24:54 +0000 (01:24 +0200)]
Efence is antiquated, remove all traces of using it

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1768)

8 years agoCorrect installation test in appveyor
Richard Levitte [Fri, 21 Oct 2016 09:55:04 +0000 (11:55 +0200)]
Correct installation test in appveyor

Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1759)

8 years agoFix grammar error in SSL_CTX_set_min_proto_version
Claus Assmann [Fri, 21 Oct 2016 10:15:39 +0000 (06:15 -0400)]
Fix grammar error in SSL_CTX_set_min_proto_version

CLA: trivial
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1762)