openssl.git
8 years agochacha/asm/chacha-x86[_64].pl: fix typos and logical errors.
Andy Polyakov [Sat, 13 Feb 2016 12:37:25 +0000 (13:37 +0100)]
chacha/asm/chacha-x86[_64].pl: fix typos and logical errors.

Thanks to: David Benjamin of Chromuim.

RT#4305

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agomake update
Richard Levitte [Sun, 14 Feb 2016 18:42:10 +0000 (19:42 +0100)]
make update

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoDon't use libcrypto private headers with mkdef.pl
Richard Levitte [Sun, 14 Feb 2016 18:37:10 +0000 (19:37 +0100)]
Don't use libcrypto private headers with mkdef.pl

Three header files from crypto/include/internal were used by
util/mkdef.pl.  This should never be needed.  Some test program used
these, which made it a valid reason at the time to make the some
internal symbols public in the shared libraries, but that's not the
case any more.

However, to be able to link libssl.so, some symbols found in
include/internal headers still need to be made public.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoMake sure to use unsigned char for is*() functions
Richard Levitte [Sun, 14 Feb 2016 12:02:15 +0000 (13:02 +0100)]
Make sure to use unsigned char for is*() functions

On some platforms, the implementation is such that a signed char
triggers a warning when used with is*() functions.  On others, the
behavior is outright buggy when presented with a char that happens
to get promoted to a negative integer.

The safest thing is to cast the char that's used to an unsigned char.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoMake the use of mdebug backtrace a separate option
Richard Levitte [Sun, 14 Feb 2016 11:16:52 +0000 (12:16 +0100)]
Make the use of mdebug backtrace a separate option

To force it on anyone using --strict-warnings was the wrong move, as
this is an option best left to those who know what they're doing.

Use with care!

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoDeclare DllMain internally
Richard Levitte [Sun, 14 Feb 2016 10:48:47 +0000 (11:48 +0100)]
Declare DllMain internally

DllMain is a symbol that needs to be global, but no one needs to know.
However, some compilers will warn if there isn't a declaration before
the function is defined.  Just add a declaration before the function
definition.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoDon't test heartbeats when there aren't any.
Ben Laurie [Sun, 14 Feb 2016 05:52:12 +0000 (05:52 +0000)]
Don't test heartbeats when there aren't any.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMake sure a socklen_t can compare with a sizeof() result
Richard Levitte [Sun, 14 Feb 2016 10:16:37 +0000 (11:16 +0100)]
Make sure a socklen_t can compare with a sizeof() result

Most of the times, it seems that socklen_t is unsigned.
Unfortunately, this isn't always the case, and it doesn't compare with
a size_t without warning.

A cast resolves the issue.

Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoHave dofile.pl say where it was run, for real this time
Richard Levitte [Sun, 14 Feb 2016 07:47:47 +0000 (08:47 +0100)]
Have dofile.pl say where it was run, for real this time

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoHave dofile.pl say where it was run
Richard Levitte [Sun, 14 Feb 2016 05:55:45 +0000 (06:55 +0100)]
Have dofile.pl say where it was run

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoPrefer IO::Socket::INET6 over IO::Socket::IP
Richard Levitte [Sun, 14 Feb 2016 06:10:38 +0000 (07:10 +0100)]
Prefer IO::Socket::INET6 over IO::Socket::IP

While IO::Socket::IP is a core perl module (since Perl v5.19.8, or so
says corelist), IO::Socket::INET6 has been around longer, is said to
be more widely deployed, and most importantly, seems to have less bugs
hitting us.  We therefore prefer IO::Socket::INET6, and only fall back
to IO::Socket::IP if the former doesn't exist on the local system.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agocrypto/poly1305: add floating-point reference implementation.
Andy Polyakov [Sat, 12 Dec 2015 11:46:17 +0000 (12:46 +0100)]
crypto/poly1305: add floating-point reference implementation.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT4304: Look for plaintext HTTP
Rainer Jung [Sat, 13 Feb 2016 13:03:23 +0000 (08:03 -0500)]
RT4304: Look for plaintext HTTP

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoGH675: make ssl3_ciphers static
Viktor Szakats [Sat, 13 Feb 2016 17:46:30 +0000 (18:46 +0100)]
GH675: make ssl3_ciphers static

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoPass $(CC) to perlasm scripts via the environment
Richard Levitte [Sat, 13 Feb 2016 18:15:52 +0000 (19:15 +0100)]
Pass $(CC) to perlasm scripts via the environment

It seems that on some platforms, the perlasm scripts call the C
compiler for certain checks.  These scripts need the environment
variable CC to have the C compiler command.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoReformat warn variables for easier editing.
Rich Salz [Sat, 13 Feb 2016 17:27:11 +0000 (12:27 -0500)]
Reformat warn variables for easier editing.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoDon't build test programs by default, add convenience targets for unified build
Richard Levitte [Sat, 13 Feb 2016 17:15:51 +0000 (18:15 +0100)]
Don't build test programs by default, add convenience targets for unified build

Test programs are now only built when running "make test" or "make
build_tests".

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoHave the same installation directories in unified as in unixmake
Richard Levitte [Sat, 13 Feb 2016 16:55:48 +0000 (17:55 +0100)]
Have the same installation directories in unified as in unixmake

unix-Makefile.tmpl was lagging behind on this point.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoConfigurations: engage PPC ChaCha20 and Poly1305 modules.
Andy Polyakov [Wed, 10 Feb 2016 10:52:22 +0000 (11:52 +0100)]
Configurations: engage PPC ChaCha20 and Poly1305 modules.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoPPC assembly pack: add ChaCha20 and Poly1305 modules.
Andy Polyakov [Wed, 10 Feb 2016 10:51:23 +0000 (11:51 +0100)]
PPC assembly pack: add ChaCha20 and Poly1305 modules.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoAdd SHARED_RCFLAGS in unified Makefile template
Richard Levitte [Sat, 13 Feb 2016 14:50:59 +0000 (15:50 +0100)]
Add SHARED_RCFLAGS in unified Makefile template

Also remove a spurious extra $(LDFLAGS)

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoasync_win.c: remove unused variable
Viktor Szakats [Sat, 13 Feb 2016 14:20:47 +0000 (15:20 +0100)]
async_win.c: remove unused variable

Silencing this:
    crypto/async/arch/async_win.c: In function 'async_fibre_init_dispatcher':
    crypto/async/arch/async_win.c:112:12: warning: unused variable 'dispatcher' [-Wunused-variable]
         LPVOID dispatcher;
                ^

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoThe unified build may delete installed manual files
Richard Levitte [Sat, 13 Feb 2016 12:52:24 +0000 (13:52 +0100)]
The unified build may delete installed manual files

The installation of man files and html files alike didn't properly
check that file names with different casing could be the same on
case-insensitive file systems.  This change fixes that.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH650: Minor tidying around the ocsp app
Benjamin Kaduk [Wed, 10 Feb 2016 02:29:21 +0000 (20:29 -0600)]
GH650: Minor tidying around the ocsp app

The ocsp utility is something of a jack-of-all-trades; most anything
related to the OCSP can be done with it.  In particular, the manual
page calls out that it can be used as either a client or a server
of the protocol, but there are also a few things that it can do
which do not quite fit into either role, such as encoding an OCSP
request but not sending it, printing out a text form of an OCSP
response (or request) from a file akin to the asn1parse utility,
or performing a lookup into the server-side revocation database
without actually sending a request or response.  All three of these
are documented as examples in the manual page, but the documentation
prior to this commit is somewhat misleading, in that when printing
the text form of an OCSP response, the code also attempts to
verify the response, displaying an error message and returning
failure if the response does not verify.  (It is possible that
the response would be able to verify with the given example, since
the default trust roots are used for that verification, but OCSP
responses frequently have alternate certification authorities
that would require passing -CAfile or -CApath for verification.)

Tidy up the documentation by passing -noverify for the case of
converting from binary to textual representation, and also
change a few instances of -respin to -reqin as appropriate, note
that the -url option provides the same functionality as the -host
and -path options, clarify that the example that saves an OCSP
response to a file will also perform verification on that response,
and fix a couple grammar nits in the manual page.

Also remove an always-true conditional for rdb != NULL -- there
are no codepaths in which it could be initialized at the time of
this check.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoDisplay the windres command
Richard Levitte [Sat, 13 Feb 2016 14:01:22 +0000 (15:01 +0100)]
Display the windres command

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH643: Cleanup header analysis
Dmitry-Me [Wed, 10 Feb 2016 06:37:52 +0000 (09:37 +0300)]
GH643: Cleanup header analysis

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
8 years agoFree and zero DH/ECDH temporary key after use.
Dr. Stephen Henson [Sat, 13 Feb 2016 02:27:33 +0000 (02:27 +0000)]
Free and zero DH/ECDH temporary key after use.

PR#4303

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoRethink the method to place user cflags last
Richard Levitte [Sat, 13 Feb 2016 12:02:35 +0000 (13:02 +0100)]
Rethink the method to place user cflags last

The previous method had some unfortunate consequences with
--strict-warnings.  To counteract, revert part of the previous change
and move down the block of code that adds the user cflags and defines.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoMake sure the OPENSSL_INIT flags are 32 bits and document the ssl range
Richard Levitte [Sat, 13 Feb 2016 11:37:39 +0000 (12:37 +0100)]
Make sure the OPENSSL_INIT flags are 32 bits and document the ssl range

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove 00-test_checkexes.t, as it has lost its relevance
Richard Levitte [Sat, 13 Feb 2016 10:49:56 +0000 (11:49 +0100)]
Remove 00-test_checkexes.t, as it has lost its relevance

In the early stages of creating the new test framework,
00-test_checkexes was a temporary check to ensure we had a recipe for
every test program in test/.  By now, this test has fulfilled its
purpose, and we've learned how to make recipes properly.  It's time
for this check to go away.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoIn templates, output_on() must be used the same way as output_off()
Richard Levitte [Sat, 13 Feb 2016 08:35:02 +0000 (09:35 +0100)]
In templates, output_on() must be used the same way as output_off()

Otherwise, there will be an unbalance.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoC64x+ assembly pack: add ChaCha20 and Poly1305 modules.
Andy Polyakov [Tue, 15 Dec 2015 20:52:01 +0000 (21:52 +0100)]
C64x+ assembly pack: add ChaCha20 and Poly1305 modules.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoConfigurations: engage ARM ChaCha20 and Poly1305 modules.
Andy Polyakov [Wed, 10 Feb 2016 10:59:45 +0000 (11:59 +0100)]
Configurations: engage ARM ChaCha20 and Poly1305 modules.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoARM assembly pack: add ChaCha20 and Poly1305 modules.
Andy Polyakov [Mon, 14 Dec 2015 17:12:07 +0000 (18:12 +0100)]
ARM assembly pack: add ChaCha20 and Poly1305 modules.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoapps/speed.c: initialize c[D_GHASH][i].
Andy Polyakov [Fri, 12 Feb 2016 13:53:51 +0000 (14:53 +0100)]
apps/speed.c: initialize c[D_GHASH][i].

RT#4230

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoDefines OSSL_SSIZE_MAX
Rob Percival [Fri, 12 Feb 2016 15:12:37 +0000 (15:12 +0000)]
Defines OSSL_SSIZE_MAX

Removes SSIZE_MAX definition from bss_bio.c and changes that file to use
OSSL_SSIZE_MAX.

No need to account for OPENSSL_SYS_VXWORKS, since that never actually
gets defined anywhere. It must be a historical artifact.

Reviewed-by: Richard Levitte <levitte@openssl.org>
Reviewed-by: Ben Laurie <ben@openssl.org>
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>