Richard Levitte [Fri, 8 Jul 2016 16:13:17 +0000 (18:13 +0200)]
Make fuzzer and fuzz tester builds less magic
Instead of having fuzz/build.info.fuzz magically and conditionally
included along with the other build.info files, incorporate it in
fuzz/build.info and add the conditions there instead.
Richard Levitte [Fri, 15 Jul 2016 10:57:27 +0000 (12:57 +0200)]
Windows: allow input and output flags to end with a space, or not
With a number of tools, especially those coming with Visual Studio,
some command options are separated from their argument with a space,
others with a space. Since we parametrise them, we can't know
beforehand which it will be, so we must allow the input and output
options to have either.
However, spaces at the end of nmake macro values are trimmed, so allow
spaces to exist by adding a reference to an undefined macro at the end.
Richard Levitte [Thu, 14 Jul 2016 07:23:36 +0000 (09:23 +0200)]
Windows: take care of manifest files
The easiest way to take care of manifest files is to integrate them
into the associated binary (.exe or .dll). MT (the Manifest Tool) is
the utility to use for this.
David Benjamin [Mon, 11 Jul 2016 03:35:04 +0000 (23:35 -0400)]
Fix DH error-handling in tls_process_key_exchange.
The set0 setters take ownership of their arguments, so the values should
be set to NULL to avoid a double-free in the cleanup block should
ssl_security(SSL_SECOP_TMP_DH) fail. Found by BoringSSL's WeakDH test.
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1299)
Viktor Dukhovni [Mon, 11 Jul 2016 00:36:02 +0000 (20:36 -0400)]
Perform DANE-EE(3) name checks by default
In light of potential UKS (unknown key share) attacks on some
applications, primarily browsers, despite RFC761, name checks are
by default applied with DANE-EE(3) TLSA records. Applications for
which UKS is not a problem can optionally disable DANE-EE(3) name
checks via the new SSL_CTX_dane_set_flags() and friends.
Richard Levitte [Sat, 9 Jul 2016 09:06:44 +0000 (11:06 +0200)]
VMS: Adjust the engines directory by adding the pointer size to its name
With OpenSSL 1.1 and on, the engines are tightly tied to the shared
library they're to be used with. That makes them depend on the
pointer size as well as the shared library version, and this gets
reflected in the name of the directory they're installed in.
Richard Levitte [Fri, 8 Jul 2016 16:35:38 +0000 (18:35 +0200)]
VMS: OSSL$EXE: needs to reflect that programs are installed in two places
We're installing architecture dependent (compiled) programs in
architecture specific directories, while architecture independent
programs (scripts) get installed in the general programs directory.
OSSL$EXE: reflects that by having two values.
Richard Levitte [Fri, 8 Jul 2016 16:27:56 +0000 (18:27 +0200)]
VMS: Simplify the spec of the default certs & keys area.
We previously had a number of logical names for the different parts.
There's really no need for that, the default directories are in one
directory tree. So we only define OSSL$DATAROOT: and make everything
related to that one.
Commit aea145e removed some error codes that are generated
algorithmically: mapping alerts to error texts. Found by
Andreas Karlsson. This restores them, and adds two missing ones.
Matt Caswell [Thu, 7 Jul 2016 10:05:31 +0000 (11:05 +0100)]
Disallow multiple protocol flags to s_server and s_client
We shouldn't allow both "-tls1" and "-tls1_2", or "-tls1" and "-no_tls1_2".
The only time multiple flags are allowed is where they are all "-no_<prot>".
Richard Levitte [Fri, 8 Jul 2016 11:33:27 +0000 (13:33 +0200)]
Unix: Set the execute permission on installed shared libraries
Some Unix variants require shared libraries to have the execute
permissions set, or they won't be loadable or executable when loaded.
Among others, cygwin has this requirement.
Richard Levitte [Fri, 8 Jul 2016 12:11:43 +0000 (14:11 +0200)]
Reorganize .gitignore to make better use of its features
It's possible to have a very few rules for some directories and trust
that other patterns further along will take care of whatever is left.
.gitignore should therefore be loosely organised from least generic to
most generic, allowing things like this:
# Keep any file with extensions, such as foo.c, bar.h, ...
!/dir/*.*
# ....
# Remove all object files
*.o
*.obj
With this change, we implement some very generic rules for what will
and will not be ignored in the fuzz subdirectory, and truse that
patterns later on (such as *.o, *.obj, *.exe) will take care of
everything we didn't specifically specify for the fuzz subdirectory.
Andy Polyakov [Sun, 26 Jun 2016 11:40:15 +0000 (13:40 +0200)]
include/openssl: don't include <windows.h> in public headers.
If application uses any of Windows-specific interfaces, make it
application developer's respondibility to include <windows.h>.
Rationale is that <windows.h> is quite "toxic" and is sensitive
to inclusion order (most notably in relation to <winsock2.h>).
It's only natural to give complete control to the application developer.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Matt Caswell <matt@openssl.org>
Richard Levitte [Wed, 6 Jul 2016 16:53:56 +0000 (18:53 +0200)]
Versioning engines default location: the VMS case
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1. We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.
For VMS, the change is a bit more involved, primarly because the top
installation directory was already versioned, *as well as* some of the
files inside. That's a bit too much. Version numbering in files is
also a bit different on VMS. The engines for shared library version
1.1 will therefore end up in OSSL$INSTROOT:[ENGINES0101.'arch']
Richard Levitte [Wed, 6 Jul 2016 16:50:47 +0000 (18:50 +0200)]
Versioning engines default location: the Unix case
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1. We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.
For Unix, the default installation directory is changed from
$PREFIX/lib/engines to $PREFIX/lib/engines-${major}_${minor} (mingw)
or $PREFIX/lib/engines-${major}.${minor} (all but mingw)
($PREFIX is the directory given for the configuration option --prefix,
and ${major} and ${minor} are the major and minor shared library
version numbers)
Richard Levitte [Wed, 6 Jul 2016 16:37:52 +0000 (18:37 +0200)]
Versioning engines default location: the Windows case
OpenSSL engines are tied to the OpenSSL shared library versions,
starting with OpenSSL 1.1. We therefore need to install them in
directories which have the shared library version in it's name, to
easily allow multiple OpenSSL versions to be installed at the same
time.
For windows, the default installation directory is changed from
$PREFIX/lib/engines to $PREFIX/lib/engines-${major}_${minor}
($PREFIX is the directory given for the configuration option --prefix,
and ${major} and ${minor} are the major and minor shared library
version numbers)
Richard Levitte [Wed, 6 Jul 2016 00:08:53 +0000 (02:08 +0200)]
VMS: make sure there's a file extension when creating files
When creating the library $lib.olb, make sure the extension is there.
Otherwise, a logical name with the same name as the file in question
will redirect the creation elsewhere.
Richard Levitte [Sat, 2 Jul 2016 14:39:15 +0000 (16:39 +0200)]
perl: Separate compile-time environment from runtime environment
Make it possible to have a separate and different perl command string
for installable scripts than we use when building, with the
environment variable HASHBANGPERL. Its value default to the same as
the environment PERL if it's defined, otherwise '/usr/bin/env perl'.
Note: this is only relevant for Unix-like environments.
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org>
The SSL_load_client_CA_file() failed to load any CAs due to an
inccorrect assumption about the return value of lh_*_insert(). The
return value when inserting into a hash is the old value of the key.
Richard Levitte [Sat, 2 Jul 2016 08:28:39 +0000 (10:28 +0200)]
VMS: Add installation verification procedure
On VMS, it's customary to have a procedure to check that the software
was installed correctly and can run as advertised.
The procedure added here is fairly simple, it checks that all
libraries are in place, that the header crypto.h is in place, and that
the command 'openssl version -a' runs without trouble.
Richard Levitte [Sat, 2 Jul 2016 06:47:08 +0000 (08:47 +0200)]
Fix some VMS inconsistencies
- The install top is versioned by default. However, only the major
version should be used.
- the default areas for certs, private keys an config files have
changed, now all prefixed with 'OSSL$'. This gets reflected in
cryptlib.h.
- [.VMS]openssl_startup.com.in had some faults regarding creating
rooted concealed logical names.
Matt Caswell [Fri, 1 Jul 2016 10:58:05 +0000 (11:58 +0100)]
Avoid an overflow in constructing the ServerKeyExchange message
We calculate the size required for the ServerKeyExchange message and then
call BUF_MEM_grow_clean() on the buffer. However we fail to take account of
2 bytes required for the signature algorithm and 2 bytes for the signature
length, i.e. we could overflow by 4 bytes. In reality this won't happen
because the buffer is pre-allocated to a large size that means it should be
big enough anyway.
Rich Salz [Wed, 29 Jun 2016 16:23:16 +0000 (12:23 -0400)]
Cleanup obj_dat.h, obj_dat.pl
The recent merge of https://github.com/openssl/openssl/pull/1264
removed some trailing whitespace from the generated file obj_dat.h.
Unfortunately obj_dat.pl kept re-adding it. Clean up the
script and the output it generates.
Add 'use strict / use warnings'
Reviewed-by: Richard Levitte <levitte@openssl.org>
Richard Levitte [Wed, 29 Jun 2016 20:51:42 +0000 (22:51 +0200)]
Make build.info INCLUDE stmts be both source and build tree relative
INCLUDE statements in build.info files were source tree centric. That
meant that to get include directory specs in the build tree, we had to
resort to perl fragments that specified the build tree include paths
as absolute ones.
This change has the INCLUDE statement consider both the source and
build tree for any include directory. It means that there may be some
extra unnecessary include paths, but it also makes life simpler for
anyone who makes changes in the build.info files.
Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Stephen Henson <steve@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1273)
Viktor Szakats [Fri, 1 Jul 2016 11:40:33 +0000 (13:40 +0200)]
ssl.h: spelling in comment Reviewed-by: Matt Caswell <matt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1275)
Andy Polyakov [Thu, 30 Jun 2016 13:57:57 +0000 (15:57 +0200)]
SPARC assembly pack: enforce V8+ ABI constraints.
Even though it's hard to imagine, it turned out that upper half of
arguments passed to V8+ subroutine can be non-zero.
["n" pseudo-instructions, such as srln being srl in 32-bit case and
srlx in 64-bit one, were implemented in binutils 2.10. It's assumed
that Solaris assembler implemented it around same time, i.e. 2000.]
Reviewed-by: Richard Levitte <levitte@openssl.org>
Richard Levitte [Wed, 29 Jun 2016 22:10:21 +0000 (00:10 +0200)]
Windows: Recreate the $prefix variable
$prefix was removed as part of the DESTDIR work. However, it was
still used to create the ENGINESDIR_dev and ENGINESDIR_dir variables,
so a restoration is needed.
Matt Caswell [Mon, 27 Jun 2016 11:28:32 +0000 (12:28 +0100)]
Add some compat macros for removed tmp RSA functions/macros
Commit 361a119 removed all ciphersuites that could support temporary
RSA keys, therefore the associated functions were removed. We should have
"no-op" compatibility macros for these.
Richard Levitte [Wed, 29 Jun 2016 23:23:36 +0000 (01:23 +0200)]
Remove the envvar hack to enable proxy cert processing
When the proxy cert code was initially added, some application authors
wanted to get them verified without having to change their code, so a
check of the env var OPENSSL_ALLOW_PROXY_CERTS was added.
Since then, the use of this variable has become irrelevant, as it's
likely that code has been changed since, so it's time it gets removed.
FdaSilvaYY [Tue, 28 Jun 2016 20:51:51 +0000 (22:51 +0200)]
Whitespace cleanup in apps
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1264)
FdaSilvaYY [Tue, 28 Jun 2016 20:51:27 +0000 (22:51 +0200)]
Whitespace cleanup in ssl folder
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1264)
FdaSilvaYY [Tue, 28 Jun 2016 20:51:01 +0000 (22:51 +0200)]
Whitespace cleanup in crypto
Reviewed-by: Andy Polyakov <appro@openssl.org> Reviewed-by: Kurt Roeckx <kurt@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
(Merged from https://github.com/openssl/openssl/pull/1264)