oweals/openssl.git
8 years agoFix some issues near recent chomp changes.
Viktor Dukhovni [Sat, 13 Feb 2016 07:53:13 +0000 (02:53 -0500)]
Fix some issues near recent chomp changes.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agofix warnings on 32 bit builds
Dr. Stephen Henson [Fri, 12 Feb 2016 22:24:39 +0000 (22:24 +0000)]
fix warnings on 32 bit builds

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoWe need the linked utils after a full build.
Richard Levitte [Wed, 10 Feb 2016 18:18:33 +0000 (19:18 +0100)]
We need the linked utils after a full build.

We really needs a better util/shlib_wrap.sh, but will have to do for now.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUnified build - fix make depend
Richard Levitte [Fri, 12 Feb 2016 13:05:06 +0000 (14:05 +0100)]
Unified build - fix make depend

There was a catch 22, where 'make depend' directly after configuring
in an otherwise pristine build tree would fail because buildinf.h
didn't exist yet.

This change has the depend building targets depend on the same other
targets as the object file building targets, so the generation of
buildinf.h and similar files would kick in during 'make depend'.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMove brace outside #ifdef
Viktor Dukhovni [Fri, 12 Feb 2016 21:36:06 +0000 (16:36 -0500)]
Move brace outside #ifdef

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoevp/e_des[3].c: address compiler warnings, fix formatting.
Andy Polyakov [Fri, 12 Feb 2016 13:46:02 +0000 (14:46 +0100)]
evp/e_des[3].c: address compiler warnings, fix formatting.

RT#4210

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agomodes/ctr128.c: pay attention to ecount_buf alignment in CRYPTO_ctr128_encrypt.
Andy Polyakov [Fri, 12 Feb 2016 13:07:27 +0000 (14:07 +0100)]
modes/ctr128.c: pay attention to ecount_buf alignment in CRYPTO_ctr128_encrypt.

It's never problem if CRYPTO_ctr128_encrypt is called from EVP, because
buffer in question is always aligned within EVP_CIPHER_CTX structure.

RT#4218

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRename INSTALL_PREFIX to DESTDIR, remove option --install_prefix
Richard Levitte [Fri, 12 Feb 2016 20:14:03 +0000 (21:14 +0100)]
Rename INSTALL_PREFIX to DESTDIR, remove option --install_prefix

INSTALL_PREFIX is a confusing name, as there's also --prefix.
Instead, tag along with the rest of the open source world and adopt
the Makefile variable DESTDIR to designate the desired staging
directory.

The Configure option --install_prefix is removed, the only way to
designate a staging directory is with the Makefile variable (this is
also implemented for VMS' descrip.mms et al).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUpdate .gitignore.
Andy Polyakov [Fri, 12 Feb 2016 13:13:06 +0000 (14:13 +0100)]
Update .gitignore.

Not all git versions understand **/Makefile, but all recognize that
filename without any path applies to all directories.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years ago.travis.yml: exclude gcc from MacOS X CI builds.
Andy Polyakov [Fri, 12 Feb 2016 10:45:44 +0000 (11:45 +0100)]
.travis.yml: exclude gcc from MacOS X CI builds.

Contemporary Xcode gcc is a front-end to clang, so that explicit
gcc build is actually redundant on MacOS X.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoPut user flags last for priority.
Rich Salz [Fri, 12 Feb 2016 19:40:33 +0000 (14:40 -0500)]
Put user flags last for priority.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoec/asm/ecp_nistz256-armv8.pl: fix test_ssl spurious errors.
Andy Polyakov [Fri, 12 Feb 2016 10:28:22 +0000 (11:28 +0100)]
ec/asm/ecp_nistz256-armv8.pl: fix test_ssl spurious errors.

RT#4237

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoNow that we have good verbosity, turn it on for Travis
Richard Levitte [Fri, 12 Feb 2016 17:42:46 +0000 (18:42 +0100)]
Now that we have good verbosity, turn it on for Travis

It's nearly impossible to determine what goes wrong in the tests
running there without this.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDocument the changes in "make test" behavior
Richard Levitte [Fri, 12 Feb 2016 17:33:34 +0000 (18:33 +0100)]
Document the changes in "make test" behavior

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoLet all TLSProxy based tests display debug text conditionally
Richard Levitte [Fri, 12 Feb 2016 17:26:16 +0000 (18:26 +0100)]
Let all TLSProxy based tests display debug text conditionally

If the environment variable HARNESS_ACTIVE isn't defined or
HARNESS_VERBOSE is defined, it's probable that lots of output is
desired.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRethink logging of test recipes
Richard Levitte [Fri, 12 Feb 2016 17:16:23 +0000 (18:16 +0100)]
Rethink logging of test recipes

The logging that was performed in OpenSSL::Test was initially set up
as a means not to let messages that test programs write to STDERR get
displayed when a test isn't running in verbose mode.  However, the way
it was implemented, it meant that those messages were never displayed,
and you had to look in a test log.  This also meant that output to
STDERR and output to STDOUT got broken apart, which isn't optimal.

So, we remove the whole test log file implementation, and instead,
we're sending STDERR to the null device unless one of these conditions
apply:

- the test recipe already redirects stderr.  Just let it.
- the environment variable HARNESS_ACTIVE is undefined, meaning the
  recipe is run directly as a perl script instead of being harnessed
  by Test::Harness
- the environment variable HARNESS_VERBOSE is set.

Getting a full log of the tests now becomes as simple as this:

    HARNESS_VERBOSE=yes make test 2>&1 | tee tests.log

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoBetter workaround for VMS getnameinfo() bug
Richard Levitte [Fri, 12 Feb 2016 18:44:55 +0000 (19:44 +0100)]
Better workaround for VMS getnameinfo() bug

The actual bug with current getnameinfo() on VMS is not that it puts
gibberish in the service buffer, but that it doesn't touch it at all.
The gibberish we dealt with before was simply stuff that happened to
be on the stack.

It's better to initialise the service buffer properly (with the empty
string) and check if it's still an empty string after the
getnameinfo() call, and fill it with the direct numerical translation
of the raw port if that's the case.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdjust transfer::Text::Template.pm for alternate directory name
Richard Levitte [Fri, 12 Feb 2016 03:23:15 +0000 (04:23 +0100)]
Adjust transfer::Text::Template.pm for alternate directory name

On VMS, periods in directory names weren't allowed.  To counter that,
unpackers such as VMSTAR convert periods in directory names to
underscores.  We need to count that in and add an alternative library
path for Text::Template.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT 3854: Update apps/req
Emilia Kasper [Tue, 2 Feb 2016 16:12:45 +0000 (17:12 +0100)]
RT 3854: Update apps/req

Change the default keysize to 2048 bits, and the minimum to 512 bits.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove last chomps
Richard Levitte [Fri, 12 Feb 2016 11:10:27 +0000 (12:10 +0100)]
Remove last chomps

In the previous commit to change all chomp to a more flexible regexp,
Configure was forgotten.  This completes the change.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoFix the enable-ssl-trace config option
Matt Caswell [Fri, 12 Feb 2016 10:06:45 +0000 (10:06 +0000)]
Fix the enable-ssl-trace config option

The recent removal of static ECDH broke the enable-ssl-trace compilation.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agomake generate
Richard Levitte [Thu, 11 Feb 2016 23:38:53 +0000 (00:38 +0100)]
make generate

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGenerate progs.h from a bunch of files instead of internal knowledge
Richard Levitte [Thu, 11 Feb 2016 23:34:40 +0000 (00:34 +0100)]
Generate progs.h from a bunch of files instead of internal knowledge

apps/progs.pl counted on the caller to provide the exact command
files.  The unified build doesn't have that knowledge, and the easier
and more flexible thing to do is to feed it all the apps/*.c files and
let it figure out the command names by looking inside (looking for
/int ([a-z0-9][a-z0-9_]*)_main\(int argc,/).

Also, add it to the generate command, since it's a versioned file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoTypo: only return error if unrecognise bag type.
Dr. Stephen Henson [Thu, 11 Feb 2016 22:46:01 +0000 (22:46 +0000)]
Typo: only return error if unrecognise bag type.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoState the minimum Perl version that our scripts will work with
Richard Levitte [Thu, 11 Feb 2016 21:06:17 +0000 (22:06 +0100)]
State the minimum Perl version that our scripts will work with

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoPerl's chop / chomp considered bad, use a regexp instead
Richard Levitte [Thu, 11 Feb 2016 20:47:30 +0000 (21:47 +0100)]
Perl's chop / chomp considered bad, use a regexp instead

Once upon a time, there was chop, which somply chopped off the last
character of $_ or a given variable, and it was used to take off the
EOL character (\n) of strings.

... but then, you had to check for the presence of such character.

So came chomp, the better chop which checks for \n before chopping it
off.  And this worked well, as long as Perl made internally sure that
all EOLs were converted to \n.

These days, though, there seems to be a mixture of perls, so lines
from files in the "wrong" environment might have \r\n as EOL, or just
\r (Mac OS, unless I'm misinformed).

So it's time we went for the more generic variant and use s|\R$||, the
better chomp which recognises all kinds of known EOLs and chops them
off.

A few chops were left alone, as they are use as surgical tools to
remove one last slash or one last comma.

NOTE: \R came with perl 5.10.0.  It means that from now on, our
scripts will fail with any older version.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoupdate ciphers manual page
Dr. Stephen Henson [Thu, 11 Feb 2016 18:41:11 +0000 (18:41 +0000)]
update ciphers manual page

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoRemove static ECDH support.
Dr. Stephen Henson [Thu, 11 Feb 2016 18:19:27 +0000 (18:19 +0000)]
Remove static ECDH support.

Remove support for static ECDH ciphersuites. They require ECDH keys
in certificates and don't support forward secrecy.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoperlasm/x86_64-xlate.pl: pass pure constants verbatim.
Andy Polyakov [Wed, 10 Feb 2016 14:11:40 +0000 (15:11 +0100)]
perlasm/x86_64-xlate.pl: pass pure constants verbatim.

RT#3885

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoutil/mk1mf.pl: use LINK_CMD instead of LINK variable.
Andy Polyakov [Wed, 3 Feb 2016 17:21:00 +0000 (18:21 +0100)]
util/mk1mf.pl: use LINK_CMD instead of LINK variable.

Trouble is that LINK variable assignment in make-file interferes with
LINK environment variable, which can be used to modify Microsoft's
LINK.EXE behaviour.

RT#4289

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agopoly1305/asm/poly1305-x86_64.pl: MacOS X portability fix.
Andy Polyakov [Thu, 11 Feb 2016 08:39:37 +0000 (09:39 +0100)]
poly1305/asm/poly1305-x86_64.pl: MacOS X portability fix.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agopoly1305/asm/poly1305-x86_64.pl: fix mingw64 build.
Andy Polyakov [Wed, 10 Feb 2016 23:36:48 +0000 (00:36 +0100)]
poly1305/asm/poly1305-x86_64.pl: fix mingw64 build.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd the generate mechanism from unixmake to unix-Makefile.tmpl
Richard Levitte [Thu, 11 Feb 2016 19:00:57 +0000 (20:00 +0100)]
Add the generate mechanism from unixmake to unix-Makefile.tmpl

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDon't check self signed certificate signature security.
Dr. Stephen Henson [Thu, 11 Feb 2016 15:25:11 +0000 (15:25 +0000)]
Don't check self signed certificate signature security.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix MacOS/X build warnings
Viktor Dukhovni [Thu, 11 Feb 2016 18:44:53 +0000 (13:44 -0500)]
Fix MacOS/X build warnings

Commit 7823d792d0cad3b44ad5389a8d3381becefe7f44 added DEFINE_LHASH_OF
to a C source file.  DEFINE_LHASH_OF() and DEFINE_STACK_OF() must
be used only in header files to avoid clang warnings for unused
static-inline functions.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDon't add filename comment.
Rich Salz [Thu, 11 Feb 2016 18:16:14 +0000 (13:16 -0500)]
Don't add filename comment.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRemove TLS heartbeat, disable DTLS heartbeat
Rich Salz [Mon, 25 Jan 2016 18:30:37 +0000 (13:30 -0500)]
Remove TLS heartbeat, disable DTLS heartbeat

To enable heartbeats for DTLS, configure with enable-heartbeats.
Heartbeats for TLS have been completely removed.

This addresses RT 3647

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMove to REF_DEBUG, for consistency.
Rich Salz [Sat, 30 Jan 2016 17:04:25 +0000 (12:04 -0500)]
Move to REF_DEBUG, for consistency.

Add utility macros REF_ASSERT_NOT and REF_PRINT_COUNT
This is also RT 4181

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRT3495: Add a hash for faster dup detection.
Toshikuni Fukaya [Wed, 3 Feb 2016 18:08:45 +0000 (13:08 -0500)]
RT3495: Add a hash for faster dup detection.

Updated for 1.1 by Rich Salz

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix GH 327.
Rich Salz [Thu, 21 Jan 2016 19:53:18 +0000 (14:53 -0500)]
Fix GH 327.

Valgrind complains about using unitialized memory.  So call
OPENSSL_zalloc, not malloc.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMake util/mkrc.pl location agnostic and adapt Makefile.shared
Richard Levitte [Thu, 11 Feb 2016 11:59:33 +0000 (12:59 +0100)]
Make util/mkrc.pl location agnostic and adapt Makefile.shared

With this, Cygwin and Mingw builds stand a much better chance to be
able to build outside of the source tree with the unified build.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake shared library targets more consistent
Richard Levitte [Thu, 11 Feb 2016 12:10:11 +0000 (13:10 +0100)]
Make shared library targets more consistent

On Windows POSIX layers, two files are produced for a shared library,
there's {shlibname}.dll and there's the import library {libname}.dll.a

On some/most Unix platforms, a {shlibname}.{sover}.so and a symlink
{shlibname}.so are produced.

For each of them, unix-Makefile.tmpl was entirely consistent on which
to have as a target when building a shared library or which to use as
dependency.

This change clears this up and makes it consistent, we use the
simplest form possible, {lib}.dll.a on Windows POSIX layers and
{shlibname}.so on Unix platforms.  No exception.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix engine key support in cms and req utilities.
Dr. Stephen Henson [Thu, 11 Feb 2016 15:51:31 +0000 (15:51 +0000)]
Fix engine key support in cms and req utilities.

PR#4246 and PR#4266

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoTest for and use AES CSP for RSA if present.
Dr Stephen Henson [Tue, 9 Feb 2016 14:33:51 +0000 (14:33 +0000)]
Test for and use AES CSP for RSA if present.

Some keys are attached to the full RSA CSP which doesn't support SHA2
algorithms: uses the AES CSP if present.

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoAdd support for shared_rcflag, useful for windres (Cygwin and Mingw)
Richard Levitte [Fri, 5 Feb 2016 14:17:33 +0000 (15:17 +0100)]
Add support for shared_rcflag, useful for windres (Cygwin and Mingw)

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoModernise the mingw cflags and ldflags
Richard Levitte [Fri, 5 Feb 2016 14:14:45 +0000 (15:14 +0100)]
Modernise the mingw cflags and ldflags

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUnified build: Keep track of generated header files
Richard Levitte [Thu, 11 Feb 2016 14:22:27 +0000 (15:22 +0100)]
Unified build: Keep track of generated header files

If someone runs a mixed unixmake / unified environment (the unified
build tree would obviously be out of the source tree), the unified
build will pick up on the unixmake crypto/buildinf.h because of
assumptions made around this sort of declaration (found in
crypto/build.info):

    DEPENDS[cversion.o]=buildinf.h

The assumption was that if such a header could be found in the source
tree, that was the one to depend on, otherwise it would assume it
should be in the build tree.

This change makes sure that sort of mix-up won't happen again.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove the "make depend" message
Richard Levitte [Thu, 11 Feb 2016 15:12:24 +0000 (16:12 +0100)]
Remove the "make depend" message

It's not necessary for a pristine source, and a developer that makes
changes usually knows what to do.

Also, there was this mechanism that would do a "make depend"
automatically which hasn't been used for so many years.  Removed as
well.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoSimplify ssl_cert_type() by taking advantage of X509_get0_pubkey
Viktor Dukhovni [Thu, 11 Feb 2016 04:53:54 +0000 (23:53 -0500)]
Simplify ssl_cert_type() by taking advantage of X509_get0_pubkey

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH620: second diff from rt-2275, adds error code
Rich Salz [Thu, 11 Feb 2016 14:33:51 +0000 (09:33 -0500)]
GH620: second diff from rt-2275, adds error code

clean up and apply patches from RT-2275

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoCheck malloc
Rich Salz [Thu, 11 Feb 2016 14:12:33 +0000 (09:12 -0500)]
Check malloc

Noticed by Claus Assmann <ca+ssl-dev@esmtp.org>

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMissing header include.
Rich Salz [Thu, 11 Feb 2016 13:27:53 +0000 (08:27 -0500)]
Missing header include.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoHide OPENSSL_INIT_SETTINGS.
Rich Salz [Wed, 10 Feb 2016 14:55:48 +0000 (09:55 -0500)]
Hide OPENSSL_INIT_SETTINGS.

Make OPENSSL_INIT_SETTINGS an opaque structure.
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd inclusion directory crypto/include for BN compilations
Richard Levitte [Thu, 11 Feb 2016 11:28:26 +0000 (12:28 +0100)]
Add inclusion directory crypto/include for BN compilations

Some files in crypto/bn depend on internal/bn_conf.h, and so does
test/bntest.  Therefore, we add another inclusion directory.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoThe protocol variable has lost its use, remove it
Richard Levitte [Wed, 10 Feb 2016 21:36:02 +0000 (22:36 +0100)]
The protocol variable has lost its use, remove it

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoRework BIO_ADDRINFO_protocol() to return correct values
Richard Levitte [Wed, 10 Feb 2016 21:33:44 +0000 (22:33 +0100)]
Rework BIO_ADDRINFO_protocol() to return correct values

As noted already, some platforms don't fill in ai_protocol as
expected.  To circumvent that, we have BIO_ADDRINFO_protocol() to
compute a sensible answer in that case.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoFix errstr error code parsing
Matt Caswell [Wed, 10 Feb 2016 19:41:27 +0000 (19:41 +0000)]
Fix errstr error code parsing

Error codes are printed in hex, and previous OpenSSL versions expected
the error codes to be provided to errstr in hex. In 1.1.0, for some
reason, it was expecting them to be decimal.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMake comment match reality
Richard Levitte [Wed, 10 Feb 2016 22:31:43 +0000 (23:31 +0100)]
Make comment match reality

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agouse consistent error messages
Dr. Stephen Henson [Thu, 11 Feb 2016 00:23:17 +0000 (00:23 +0000)]
use consistent error messages

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoPrint out bad content octets.
Dr. Stephen Henson [Wed, 10 Feb 2016 23:54:52 +0000 (23:54 +0000)]
Print out bad content octets.

If asn1parse doesn't like a structure print out the content octets
for diagnostic purposes.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAfter auto init, check that the deprecated functions exist before using
Richard Levitte [Wed, 10 Feb 2016 22:27:28 +0000 (23:27 +0100)]
After auto init, check that the deprecated functions exist before using

The functions that have been deprecated by the auto init changes are
now guarded with deprecation checks, so it's fairly easy to see if
they can be used.

In test/dtlsv1listentest, we simply remove all init and cleanup code,
as they are call automatically when needed.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoChange the VMS perl pointer from SF file store to the project page
Richard Levitte [Wed, 10 Feb 2016 21:25:48 +0000 (22:25 +0100)]
Change the VMS perl pointer from SF file store to the project page

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAfter renaming init, update errors.
Rich Salz [Wed, 10 Feb 2016 20:20:48 +0000 (15:20 -0500)]
After renaming init, update errors.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoBIO_PAIR_DEBUG did nothing; remove it.
Rich Salz [Wed, 10 Feb 2016 05:51:29 +0000 (00:51 -0500)]
BIO_PAIR_DEBUG did nothing; remove it.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoUse the protocol we know rather than BIO_ADDRINFO_protocol(res)
Richard Levitte [Wed, 10 Feb 2016 19:54:48 +0000 (20:54 +0100)]
Use the protocol we know rather than BIO_ADDRINFO_protocol(res)

Because some platforms won't will in any value in ai_protocol, there's
no point using it if we already know what it should be.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDon't assert protocol equality
Richard Levitte [Wed, 10 Feb 2016 19:23:40 +0000 (20:23 +0100)]
Don't assert protocol equality

It seems that some platforms' getaddrinfo don't fill in the
ai_protocol field properly.  On those, the assertion
'protocol == BIO_ADDRINFO_protocol(res)' will fail.  Best to remove
it.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoAdd CHACHA20 alias for ciphers.
Todd Short [Mon, 28 Dec 2015 14:41:52 +0000 (09:41 -0500)]
Add CHACHA20 alias for ciphers.

Update ciphers documentation as well (based on -04 rev of ID).

Signed-off-by: Kurt Roeckx <kurt@roeckx.be>
Reviewed-by: Rich Salz <rsalz@openssl.org>
RT: #4206, GH: #642

8 years agoEnsure allocation size fits into size_t
Dmitry-Me [Wed, 10 Feb 2016 19:08:09 +0000 (20:08 +0100)]
Ensure allocation size fits into size_t

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

8 years agotypo
Dr. Stephen Henson [Wed, 10 Feb 2016 19:04:08 +0000 (19:04 +0000)]
typo

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoProduce buildinf.h on Windows the same way as on Unix
Richard Levitte [Wed, 10 Feb 2016 18:11:40 +0000 (19:11 +0100)]
Produce buildinf.h on Windows the same way as on Unix

Because ENGINESDIR and OPENSSLDIR typically contains backslashes, they
need to be escaped just right.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoQuote the CFLAG in Unixly Makefiles, for buildinf.h
Richard Levitte [Wed, 10 Feb 2016 18:09:05 +0000 (19:09 +0100)]
Quote the CFLAG in Unixly Makefiles, for buildinf.h

Because the command line definitions of OPENSSLDIR and ENGINESDIR
contain quotes, we need a variant of CFLAG where backslashes and
quotes are escaped when we produce buildinf.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake sure to escape backslashes and single quotes for buildinf.h
Richard Levitte [Wed, 10 Feb 2016 18:06:54 +0000 (19:06 +0100)]
Make sure to escape backslashes and single quotes for buildinf.h

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake it possible to get ENGINESDIR info from OpenSSL_versions
Richard Levitte [Wed, 10 Feb 2016 17:51:15 +0000 (18:51 +0100)]
Make it possible to get ENGINESDIR info from OpenSSL_versions

Have apps/openssl display the result along with OPENSSLDIR

As part of this, add ENGINESDIR in util/mk1mf.pl

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd some documentation about init after deinit
Matt Caswell [Wed, 10 Feb 2016 16:17:01 +0000 (16:17 +0000)]
Add some documentation about init after deinit

Attempting to init after deinit is an error. Update the documentation
accordingly.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoUpdate CHANGES following init function renaming
Matt Caswell [Wed, 10 Feb 2016 16:02:49 +0000 (16:02 +0000)]
Update CHANGES following init function renaming

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAttempt to log an error if init failed
Matt Caswell [Wed, 10 Feb 2016 15:16:06 +0000 (15:16 +0000)]
Attempt to log an error if init failed

If init failed we'd like to set an error code to indicate that. But if
init failed then when the error system tries to load its strings its going
to fail again. We could get into an infinite loop. Therefore we just set
a single error the first time around. After that no error is set.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoThe new init functions can now fail so shouldn't be void
Matt Caswell [Wed, 10 Feb 2016 13:59:15 +0000 (13:59 +0000)]
The new init functions can now fail so shouldn't be void

The new init functions can fail if the library has already been stopped. We
should be able to indicate failure with a 0 return value.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoVariable was declared static when it shouldn't be
Matt Caswell [Wed, 10 Feb 2016 16:46:33 +0000 (16:46 +0000)]
Variable was declared static when it shouldn't be

The local variable tmp was declared static when it shouldn't be. This
is in the no-threads implementation, and it was immediately initialised
to something else on every invokation of the function so it doesn't break
anything...but still shouldn't be there.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoImprove recent option help string additions
Viktor Dukhovni [Tue, 9 Feb 2016 19:18:15 +0000 (14:18 -0500)]
Improve recent option help string additions

Make these more correct, concise and less tautological.

Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoDeprecate the -issuer_checks debugging option
Viktor Dukhovni [Tue, 9 Feb 2016 19:17:13 +0000 (14:17 -0500)]
Deprecate the -issuer_checks debugging option

This was a developer debugging feature and was never a useful public
interface.

Added all missing X509 error codes to the verify(1) manpage, but
many still need a description beyond the associated text string.

Sorted the errors in x509_txt.c by error number.

Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoThe guard macro to be defined didn't match the guard macro checked
Richard Levitte [Wed, 10 Feb 2016 17:02:59 +0000 (18:02 +0100)]
The guard macro to be defined didn't match the guard macro checked

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoUpdate unified build after store removal
Rich Salz [Wed, 10 Feb 2016 15:33:18 +0000 (10:33 -0500)]
Update unified build after store removal

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoRename INIT funtions, deprecate old ones.
Rich Salz [Tue, 9 Feb 2016 16:52:40 +0000 (11:52 -0500)]
Rename INIT funtions, deprecate old ones.

Man, there were a lot of renamings :)

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoNo dynamic-init fix; merge goof.
Rich Salz [Wed, 10 Feb 2016 13:42:33 +0000 (08:42 -0500)]
No dynamic-init fix; merge goof.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agounified build system: add CHANGES & NEWS
Richard Levitte [Sat, 30 Jan 2016 06:17:01 +0000 (07:17 +0100)]
unified build system: add CHANGES & NEWS

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: rewrite INSTALL.VMS
Richard Levitte [Sat, 30 Jan 2016 06:15:59 +0000 (07:15 +0100)]
unified build scheme: rewrite INSTALL.VMS

There is more to be added, but this will at least tell people how to try.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoclean away old VMS cruft
Richard Levitte [Sat, 30 Jan 2016 06:15:30 +0000 (07:15 +0100)]
clean away old VMS cruft

The old building scripts get removed, they are hopelessly gone in bit
rot by now.

Also remove the old symbol hacks.  They were needed needed to shorten
some names to 31 characters, and to resolve other symbol clashes.
Because we now compile with /NAMES=(AS_IS,SHORTENED), this is no
longer required.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: add a "unified" template for VMS descrip.mms
Richard Levitte [Sat, 30 Jan 2016 06:14:58 +0000 (07:14 +0100)]
unified build scheme: add a "unified" template for VMS descrip.mms

As part of this, change util/mkdef.pl to stop adding libraries to
depend on in its output.  mkdef.pl should ONLY output a symbol
vector.

Because symbol names can't be longer than 31 characters, we use the
compiler to shorten those that are longer down to 23 characters plus
an 8 character CRC.  To make sure users of our header files will pick
up on that automatically, add the DEC C supported extra headers files
__decc_include_prologue.h and __decc_include_epilogue.h.

Furthermore, we add a config.com, so VMS people can configure just as
comfortably as any Unix folks, thusly:

    @config

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: add instructions for travis to build with --unified
Richard Levitte [Thu, 4 Feb 2016 15:40:40 +0000 (16:40 +0100)]
unified build scheme: add instructions for travis to build with --unified

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: Try to nudge users to try the "unified" build
Richard Levitte [Sat, 30 Jan 2016 02:31:52 +0000 (03:31 +0100)]
unified build scheme: Try to nudge users to try the "unified" build

This commit SHALL be reverted before final release.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: add the tweaks to build on Cygwin & Mingw
Richard Levitte [Sat, 30 Jan 2016 04:45:29 +0000 (05:45 +0100)]
unified build scheme: add the tweaks to build on Cygwin & Mingw

Cygwin and Mingw name their libraries a bit differently from the rest
of the POSIXly universe, we need to adapt to that.

In Makefile.tmpl, it means that some hunks will only be output
conditionally.

This also means that shared_extension for the Cygwin and Mingw
configurations in Configurations/10-main.conf are changing from .dll.a
to .dll.  Makefile.shared does a fine job without having them
specified, and it's much easier to work with tucking an extra .a at
the end of files in the installation recipes than any amount of name
rewrites, especially with the support of the SHARED_NAME in the top
build.info.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: add a "unified" template for Unix Makefile
Richard Levitte [Sat, 30 Jan 2016 02:25:40 +0000 (03:25 +0100)]
unified build scheme: add a "unified" template for Unix Makefile

This also adds all the raw sections needed for some files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agounified build scheme: give util/dofile.pl the possibility to output selectively
Richard Levitte [Sat, 30 Jan 2016 02:21:39 +0000 (03:21 +0100)]
unified build scheme: give util/dofile.pl the possibility to output selectively

Under certain conditions, one might not want to output certain
sections of a template file.  This adds the functions output_off() and
output_on(), reachable inside the templates.  And example usage in a
Makefile template could be this:

@ : {- output_off() if $config{no_shared}; "" -}
... lines dealing with shared libraries
@ : {- output_on() -}

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoConfigure et al: move the installation directory logic to Makefiles
Richard Levitte [Sat, 30 Jan 2016 01:57:19 +0000 (02:57 +0100)]
Configure et al: move the installation directory logic to Makefiles

The logic to figure out the combinations of --prefix and --openssldir
has stayed in Configure so far, with Unix paths as defaults.

However, since we're making Configure increasingly platform agnostic,
these defaults need to change and adapt to the platform, along with
the logic to combine them.

The easiest to provide for this is to move the logic and the defaults
away from Configure and into the build files.

This also means that the definition of the macros ENGINESDIR and
OPENSSLDIR move away from include/openssl/opensslconf.h and into the
build files.

Makefile.in is adapted accordingly.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoConfigure et al: treat C defines separately
Richard Levitte [Sat, 30 Jan 2016 01:17:05 +0000 (02:17 +0100)]
Configure et al: treat C defines separately

With some compilers, C macros are defined differently on the command
line than on Unix.  It could be that the flad to define them isn't -D,
it could also be that they need to be grouped together and not be mixed
in with the other compiler flags (that's how it's done on VMS, for
example).

On Unix family platform configurations, we can continue to have macro
definitions mixed in with the rest of the flags, so the changes in
Configurations/*.conf are kept to an absolute minimum.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoCan't re-init after stop.
Rich Salz [Wed, 10 Feb 2016 05:39:29 +0000 (00:39 -0500)]
Can't re-init after stop.

Remoce DYANMIC once-init stuff.
After the library is stopped, you can't restart it.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoRemove store.
Rich Salz [Wed, 10 Feb 2016 12:52:49 +0000 (07:52 -0500)]
Remove store.

Rebased and merged by me, with Ben's approval.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Ben Laurie <ben@openssl.org>
8 years agoIf we've not been inited don't deinit
Matt Caswell [Wed, 10 Feb 2016 09:47:51 +0000 (09:47 +0000)]
If we've not been inited don't deinit

If you call an explicit deinit when we've not been inited then a seg
fault can occur. We should check that we've been inited before attempting
to deinit.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoms/uplink-x86.pl: make it work.
Andy Polyakov [Tue, 9 Feb 2016 10:53:11 +0000 (11:53 +0100)]
ms/uplink-x86.pl: make it work.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agochacha/asm/chacha-x86.pl: fix nasm compilation.
Andy Polyakov [Wed, 10 Feb 2016 10:02:12 +0000 (11:02 +0100)]
chacha/asm/chacha-x86.pl: fix nasm compilation.

Reviewed-by: Matt Caswell <matt@openssl.org>