oweals/openssl.git
8 years agoGH712: Missed some no-filenames cases
Viktor Szakats [Fri, 19 Feb 2016 11:26:17 +0000 (12:26 +0100)]
GH712:  Missed some no-filenames cases

crypto.h: honor no-filenames config setting in missing cases

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoMake sure the linked programs have the correct extension
Richard Levitte [Thu, 18 Feb 2016 16:18:55 +0000 (17:18 +0100)]
Make sure the linked programs have the correct extension

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoBig rename fest of MingW shared libraries
Richard Levitte [Tue, 16 Feb 2016 19:37:28 +0000 (20:37 +0100)]
Big rename fest of MingW shared libraries

So far, MingW shared libraries were named like this

  libeay32.dll + libeay32.dll.a
  ssleay32.dll + ssleay32.dll.a

That naming scheme is antiquated, a reminicense of SSLeay.  We're
therefore changing the scheme to something that's more like the rest
of OpenSSL.

There are two factors to remember:

  - Windows libraries have no recorded SOvers, which means that the
    shared library version must be encoded in the name.  According to
    some, it's unwise to encode extra periods in a Windows file name,
    so we convert version number periods to underscores.
  - MingW has multilib ability.  However, DLLs need to reside with the
    binaries that use them, so to allow both 32-bit and 64-bit DLLs to
    reside in the same place, we add '-x64' in the name of the 64-bit
    ones.

The resulting name scheme (for SOver 1.1) is this:

  on x86:
  libcrypto-1_1.dll + libcrypto.dll.a
  libssl-1_1.dll + libssl.dll.a

  on x86_64:
  libcrypto-1_1-x64.dll + libcrypto.dll.a
  libssl-1_1-x64.dll + libssl.dll.a

An observation is that the import lib is the same for both
architectures.  Not to worry, though, as they will be installed in
PREFIX/lib/ for x86 and PREFIX/lib64/ for x86_64.

As a side effect, MingW got its own targets in Makefile.shared.
link_dso.mingw-shared and link_app.mingw-shared are aliases for the
corresponding cygwin-shared targets.  link_shlib.mingw-shared is,
however, a target separated from the cygwin one.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoMisc small fixes.
Richard Levitte [Mon, 15 Feb 2016 21:13:41 +0000 (22:13 +0100)]
Misc small fixes.

Better libclean that removes the exact files that have been built,
nothing more and nothing less.

Corrected typo

A couple of editorial changes.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoTry removing installation directories after having uninstalled files
Richard Levitte [Mon, 15 Feb 2016 21:12:24 +0000 (22:12 +0100)]
Try removing installation directories after having uninstalled files

Of course, if there are remaining files in a directory, it won't be removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoSmall rename fest in unified, obj2dynlib -> obj2dso
Richard Levitte [Mon, 15 Feb 2016 17:45:54 +0000 (18:45 +0100)]
Small rename fest in unified, obj2dynlib -> obj2dso

Since we're using the acronym DSO everywhere else and that's a common
name for that kind of object, we might as well do so here as well.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoRemake the installation of shared libraries in unix-Makefile.tmpl
Richard Levitte [Mon, 15 Feb 2016 17:39:49 +0000 (18:39 +0100)]
Remake the installation of shared libraries in unix-Makefile.tmpl

Instead of having the installation recipe rely on special knowledge,
feed it with information, including what shared library files belong
together.  For Cygwin and Mingw, that's the .dll and its import
library .dll.a.  For Unixen, it's the shared library file name with SO
version and the one without.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoBig rename fest of engine DSO names, from libFOO.so to FOO.so
Richard Levitte [Mon, 15 Feb 2016 17:29:09 +0000 (18:29 +0100)]
Big rename fest of engine DSO names, from libFOO.so to FOO.so

The engine DSOs were named as if they were shared libraries, and could
end up having all sorts of fancy names:

  Cygwin: cygFOO.dll
  Mingw:  FOOeay32.dll
  Unix:   libFOO.so / libFOO.sl / libFOO.dylib / ...

This may be confusing, since they look like libraries one should link
with at link time, when they're just DSOs.

It's therefore time to rename them, and do it consistently on all
platforms:

  Cygwin & Mingw: FOO.dll
  Unix:           FOO.{so,sl,dylib,...}

Interestingly enough, the MSVC and VMS builds always did it this way.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoSimplify the generation of ld scripts for Linux and Solaris
Richard Levitte [Mon, 15 Feb 2016 17:19:49 +0000 (18:19 +0100)]
Simplify the generation of ld scripts for Linux and Solaris

Because we know for certain that the link_shlib targets are used
exclusively for shared libraries (libcrypto and libssl) and that they
must have an associated .num file, we don't need to check the library
name to produce an ld script.  Just do it unconditionally.

link_shlib.linux-shared can be simplified further, as most of it is
exactly the same as $(DO_GNU_SO) with just one variable modification.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoBig rename fest in makefile.shared: link_a / link_o -> link_shlib / link_dso
Richard Levitte [Mon, 15 Feb 2016 17:02:52 +0000 (18:02 +0100)]
Big rename fest in makefile.shared: link_a / link_o -> link_shlib / link_dso

Originally, the Makefile.shared targets described what they used as
input for a shared object, be it a shared library or a DSO.  It turned
out, however, that the link_o targets were used exclusively for
engines and the link_a targets were for libcrypto and libssl.

This rename fest turns and indication on the kind of input the targets
get to the intention with using them.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoCentralise the shared library / dso name info in unix-Makefile.tmpl
Richard Levitte [Mon, 15 Feb 2016 16:42:14 +0000 (17:42 +0100)]
Centralise the shared library / dso name info in unix-Makefile.tmpl

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoLet Configure figure out the diverse shared library and DSO extensions
Richard Levitte [Mon, 15 Feb 2016 16:20:15 +0000 (17:20 +0100)]
Let Configure figure out the diverse shared library and DSO extensions

Then it can pass around the information where it belongs.  The
Makefile templates pick it up along with other target data, the
DSO module gets to pick up the information through
crypto/include/internal/dso_conf.h

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoVMS fixed in unified build
Richard Levitte [Fri, 19 Feb 2016 08:53:05 +0000 (09:53 +0100)]
VMS fixed in unified build

- install_sw had a display of text that belongs under the install target
- previous layout installed architecture dependent files in
  dev:['prefix'.'arch'.LIB], dev:['prefix'.'arch'.EXE] and
  dev:['prefix'.'arch'.ENGINES].  Changed to dev:['prefix'.LIB.'arch'],
  dev:['prefix'.EXE.'arch'] and dev:['prefix'.ENGINES.'arch'] instead.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoUnified - don't install the ossltest engine
Richard Levitte [Fri, 19 Feb 2016 09:39:12 +0000 (10:39 +0100)]
Unified - don't install the ossltest engine

This is done with a simple file name comparison.  We could think of
something more elegant in the future.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoUnified - do a better job when uninstalling
Richard Levitte [Fri, 19 Feb 2016 09:38:15 +0000 (10:38 +0100)]
Unified - do a better job when uninstalling

Some directories weren't removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoRethink the uplink / applink story
Richard Levitte [Thu, 18 Feb 2016 17:43:56 +0000 (18:43 +0100)]
Rethink the uplink / applink story

Adding uplink and applink to some builds was done by "magic", the
configuration for "mingw" only had a macro definition, the Configure
would react to its presence by adding the uplink source files to
cpuid_asm_src, and crypto/build.info inherited dance to get it
compiled, and Makefile.shared made sure applink.o would be
appropriately linked in.  That was a lot under the hood.

To replace this, we create a few template configurations in
Configurations/00-base-templates.conf, inherit one of them in the
"mingw" configuration, the rest is just about refering to the
$target{apps_aux_src} / $target{apps_obj} in the right places.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoVMS: rather use a quick file comparison than DIFF
Richard Levitte [Fri, 19 Feb 2016 01:35:33 +0000 (02:35 +0100)]
VMS: rather use a quick file comparison than DIFF

VMS DIFF tries to calculate all the differences, which is slower than
just reading the files and stopping at the first difference.  The
latter doesn't exist as a command, so the problem is solved with perl
and File::Compare (has been in core perl since very early version 5).

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoVMS: produce dependency files just like you produce object files
Richard Levitte [Fri, 19 Feb 2016 01:34:20 +0000 (02:34 +0100)]
VMS: produce dependency files just like you produce object files

We need to do the same dance as when object files are created.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoFix casing on VMS
Richard Levitte [Fri, 19 Feb 2016 01:32:22 +0000 (02:32 +0100)]
Fix casing on VMS

DCL may be in extended parsing style, which makes it less case
insensitive, so when removing a string from another, make sure to get
casing correctly.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoDon't use config.timestamp, we already have configdata.pm
Richard Levitte [Fri, 19 Feb 2016 01:30:51 +0000 (02:30 +0100)]
Don't use config.timestamp, we already have configdata.pm

The benefit with using configdata.pm is that Configure writes it for
us.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoAutomatic 'make depend' for the unified build scheme
Richard Levitte [Thu, 18 Feb 2016 18:41:57 +0000 (19:41 +0100)]
'make depend' for the unified build scheme

This isn't the fully featured combination of compiler generated
dependency files and Makefile include directives, but a cheaper
variant of the same.

The dependency files are generated automatically, but then we have the
usual "depend" target.  However, we depend on it in the bigger phony
targets that are the most likely to be used.  That make this feature
automatic enough.

A side effect is that we can't use the build file's timestamp to check
if reconfiguring might be in order.  In its place, we use a flag file
that depends on Configure and the build file template and depend on it
in spots where it makes sense to check for the need to reconfigure.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix uninstall_sw for the unixmake scheme
Richard Levitte [Thu, 18 Feb 2016 21:38:21 +0000 (22:38 +0100)]
Fix uninstall_sw for the unixmake scheme

The uninstall_sw target tried to 'make uninstall' in all subdirs.
Change it to only go into $(INSTALL_SUBS), just like install_sw does.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoSet EXE_EXT environment variable when testing
Richard Levitte [Thu, 18 Feb 2016 19:50:35 +0000 (20:50 +0100)]
Set EXE_EXT environment variable when testing

When cross compiling, we may end up with someting like apps/openssl.exe
and a number of test/*.exe.  However, util/shlib_wrap.sh doesn't know
what the executable extension should be, if any, so we need to make
sure it has access to that information when testing, since
OpenSSL::Test uses that script to execute all programs.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPEND
Richard Levitte [Thu, 18 Feb 2016 12:17:15 +0000 (13:17 +0100)]
Remove all special make depend flags, as well as OPENSSL_DOING_MAKEDEPEND

All those flags existed because we had all the dependencies versioned
in the repository, and wanted to have it be consistent, no matter what
the local configuration was.  Now that the dependencies are gone from
the versioned Makefile.ins, it makes much more sense to use the exact
same flags as when compiling the object files.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoDon't treat .d (depend) files separately from object files
Richard Levitte [Thu, 18 Feb 2016 12:04:05 +0000 (13:04 +0100)]
Don't treat .d (depend) files separately from object files

.d (.MMS in the VMS world) files with just dependencies are built from
exactly the same conditions as the object files.  Therefore, the rules
for them can be built at the same time as the rules for the
corresponding object files.

This removes the requirement for a src2dep function in the build file
templates, and for common.tmpl to call it.  In the end, the existence
of depend files is entirely up to the build file.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix the makedepend constructor in unix-Makefile.tmpl
Richard Levitte [Thu, 18 Feb 2016 10:02:42 +0000 (11:02 +0100)]
Fix the makedepend constructor in unix-Makefile.tmpl

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix {TLS,CIPHER}_DEBUG compiles.
Rich Salz [Thu, 18 Feb 2016 12:59:41 +0000 (07:59 -0500)]
Fix {TLS,CIPHER}_DEBUG compiles.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agodocumentation: RSA_new_method argument
Roumen Petrov [Sat, 13 Feb 2016 08:41:49 +0000 (10:41 +0200)]
documentation: RSA_new_method argument

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoRemove outdated DEBUG flags.
Rich Salz [Thu, 18 Feb 2016 16:33:21 +0000 (11:33 -0500)]
Remove outdated DEBUG flags.

Add -DBIO_DEBUG to --strict-warnings.
Remove comments about outdated debugging ifdef guards.
Remove md_rand ifdef guarding an assert; it doesn't seem used.
Remove the conf guards in conf_api since we use OPENSSL_assert, not assert.
For pkcs12 stuff put OPENSSL_ in front of the macro name.
Merge TLS_DEBUG into SSL_DEBUG.
Various things just turned on/off asserts, mainly for checking non-NULL
arguments, which is now removed: camellia, bn_ctx, crypto/modes.
Remove some old debug code, that basically just printed things to stderr:
  DEBUG_PRINT_UNKNOWN_CIPHERSUITES, DEBUG_ZLIB, OPENSSL_RI_DEBUG,
  RL_DEBUG, RSA_DEBUG, SCRYPT_DEBUG.
Remove OPENSSL_SSL_DEBUG_BROKEN_PROTOCOL.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoremove redundant opt* declarations
Roumen Petrov [Tue, 16 Feb 2016 19:30:27 +0000 (21:30 +0200)]
remove redundant opt* declarations

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoFix typo in SSL_CTX_set_msg_callback docs
Neel Goyal [Thu, 18 Feb 2016 18:53:35 +0000 (13:53 -0500)]
Fix typo in SSL_CTX_set_msg_callback docs

Change `SSL_get_msg_callback_arg` to `SSL_set_msg_callback_arg`

Signed-off-by: Rich Salz <rsalz@akamai.com>
Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoGH681: More command help cleanup
Rich Salz [Thu, 18 Feb 2016 17:23:27 +0000 (12:23 -0500)]
GH681: More command help cleanup

enc:
 - typo in -base64 option
 - missing help opt text
ocsp, req, rsautl, s_client:
 - missing help opt text

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoFix windows thread stop code
Matt Caswell [Thu, 18 Feb 2016 12:24:09 +0000 (12:24 +0000)]
Fix windows thread stop code

The windows thread stop code was erroneously not just deleting the thread
local variable on thread stop, but also deleting the thread local *key*
(thus removing thread local data for *all* threads in one go!).

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix OPENSSL_config with NULL parameter
Roumen Petrov [Fri, 12 Feb 2016 20:18:59 +0000 (22:18 +0200)]
Fix OPENSSL_config with NULL parameter

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoFix memory leaks in tls_decrypt_ticket
Matt Caswell [Sat, 13 Feb 2016 23:22:45 +0000 (23:22 +0000)]
Fix memory leaks in tls_decrypt_ticket

Certain code paths in tls_decrypt_ticket could return early without first
freeing the HMAC_CTX or the EVP_CIPHER_CTX.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoGH706: Use NULL for pointer compare.
Zhao Junwang [Thu, 18 Feb 2016 13:59:32 +0000 (21:59 +0800)]
GH706: Use NULL for pointer compare.

As handshake_func is a function pointer, it should compare to NULL

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agotypo
Dr. Stephen Henson [Thu, 18 Feb 2016 02:49:14 +0000 (02:49 +0000)]
typo

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRemove "experimental" in code and comments, too.
Rich Salz [Wed, 10 Feb 2016 16:10:39 +0000 (11:10 -0500)]
Remove "experimental" in code and comments, too.

Thanks to Viktor for additional review.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoIn the unified scheme, there is no $(TOP), use $(SRCDIR) instead
Richard Levitte [Wed, 17 Feb 2016 23:27:04 +0000 (00:27 +0100)]
In the unified scheme, there is no $(TOP), use $(SRCDIR) instead

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix spelling
Richard Levitte [Wed, 17 Feb 2016 23:32:13 +0000 (00:32 +0100)]
Fix spelling

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFix spelling
Richard Levitte [Wed, 17 Feb 2016 23:11:18 +0000 (00:11 +0100)]
Fix spelling

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoAdd -lresolv to the Solaris ex_libs
Richard Levitte [Wed, 17 Feb 2016 23:07:54 +0000 (00:07 +0100)]
Add -lresolv to the Solaris ex_libs

The reason is that we use hstrerror() and other resolver functions.

Reporter: Erik Forsberg <erik@efca.com>

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoFinish 02f7114a7fbb3f3ac171bae87be8c13bc69e4005
David Woodhouse [Wed, 17 Feb 2016 22:04:47 +0000 (17:04 -0500)]
Finish 02f7114a7fbb3f3ac171bae87be8c13bc69e4005

Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoGet conditional priorities right
Richard Levitte [Wed, 17 Feb 2016 21:23:09 +0000 (22:23 +0100)]
Get conditional priorities right

"or" has lower priority than "||" and works better to have Perl less
confused.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoBe more verbose when debugging is on
Richard Levitte [Wed, 17 Feb 2016 21:04:54 +0000 (22:04 +0100)]
Be more verbose when debugging is on

It's near impossible to figure out what goes wrong with the execution
of sub-commands otherwise.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoRT3628: Allow filenames to be eliminated from compiled library
David Woodhouse [Thu, 30 Jul 2015 10:45:25 +0000 (11:45 +0100)]
RT3628: Allow filenames to be eliminated from compiled library

Although I explicitly don't care about the tinfoil-hat reason given in
the initial opening of RT#3628, that "paths usually contain private
information", there *are* situations where it's useful to eliminate the
filenames from the compiled binary.

The two reasons we do care about in the context of firmware such as EDK2
are that it allows for a smaller footprint, and it is also a necessary
component of a binary-reproducible build.

To that end, introduce OPENSSL_FILE and OPENSSL_LINE macros, defining
them to __FILE__ and __LINE__ respectively in the normal case, but to
"" and 0 when OPENSSL_NO_FILENAMES is set.

This is mostly a naïve invocation of
 $ sed 's/__\([FL]I[NL]E\)__/OPENSSL_\1/g' -i `git grep -l __LINE__`
but with a few instances change to just print the function name instead
(although those probably need to die anyway) and test cases left untouched.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoWhen someone configures an out-of-source build, switch to unified
Richard Levitte [Wed, 17 Feb 2016 02:23:04 +0000 (03:23 +0100)]
When someone configures an out-of-source build, switch to unified

For example, this works instead of giving a big error message (note
the lack of '--unified'):

    mkdir ../_build
    (cd ../_build/; ../openssl-src/config; make)

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoFix check of -DOPENSSL_USE_APPLINK in $config{cflags}
Richard Levitte [Tue, 16 Feb 2016 22:27:13 +0000 (23:27 +0100)]
Fix check of -DOPENSSL_USE_APPLINK in $config{cflags}

The previous fix wasn't right.

Also, change all (^|\s) and (\s|$) constructs to (?:^|\s) and (?:\s|$).
Perl seems to like that better.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoRT4310: Fix varous no-XXX builds
Rich Salz [Wed, 17 Feb 2016 18:33:51 +0000 (13:33 -0500)]
RT4310: Fix varous no-XXX builds

When OPENSSL_NO_ASYNC is set, make ASYNC_{un,}block_pause() do nothing.
This prevents md_rand.c from failing to build. Probably better to do it
this way than to wrap every instance in an explicit #ifdef.

A bunch of new socket code got added to a new file crypto/bio/b_addr.c.
Make it all go away if OPENSSL_NO_SOCK is defined.

Allow configuration with no-ripemd, no-ts, no-ui
We use these for the UEFI build.

Also remove the 'Really???' comment from no-err and no-locking. We use
those too.

We need to drop the crypto/engine directory from the build too, and also
set OPENSSL_NO_ENGINE

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Tim Hudson <tjh@openssl.org>
8 years agoremove redundant code
Dr. Stephen Henson [Wed, 17 Feb 2016 12:44:30 +0000 (12:44 +0000)]
remove redundant code

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoRT4318: Fix OSSL_SSIZE_MAX for UEFI build
David Woodhouse [Wed, 17 Feb 2016 14:11:32 +0000 (14:11 +0000)]
RT4318: Fix OSSL_SSIZE_MAX for UEFI build

Commit e634b448c ("Defines OSSL_SSIZE_MAX") introduced a definition of
OSSL_SSIZE_MAX which broke the UEFI build. Fix that by making UEFI take
the same definition as Ultrix (ssize_t == int).

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoRT4315: Fix UEFI build in crypto/init.c
David Woodhouse [Wed, 17 Feb 2016 14:54:33 +0000 (14:54 +0000)]
RT4315: Fix UEFI build in crypto/init.c

We don't have atexit() in the EDK2 environment. Firmware never exits.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoRemove JPAKE
Rich Salz [Sun, 14 Feb 2016 05:17:59 +0000 (00:17 -0500)]
Remove JPAKE

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoRT4313: Fix build for !IMPLEMENTED code path in CRYPTO_secure_free()
David Woodhouse [Wed, 17 Feb 2016 13:41:26 +0000 (13:41 +0000)]
RT4313: Fix build for !IMPLEMENTED code path in CRYPTO_secure_free()

Commit 05c7b1631 ("Implement the use of heap manipulator implementions")
added 'file' and 'line' arguments to CRYPTO_free() and friends, but neglected
to fix up the !IMPLEMENTED case within CRYPTO_secure_free(). Add the missing
arguments there too.

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoFixup secmemtest for the change of CRYPTO_free() and friends
Richard Levitte [Wed, 17 Feb 2016 10:03:55 +0000 (11:03 +0100)]
Fixup secmemtest for the change of CRYPTO_free() and friends

Switching it to use OPENSSL_free() et al when appropriate.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoFix mismatched curly brace
Dmitry-Me [Wed, 17 Feb 2016 09:10:18 +0000 (12:10 +0300)]
Fix mismatched curly brace

Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoUpdate the documentation on heap allocators / deallocators
Richard Levitte [Wed, 17 Feb 2016 01:32:27 +0000 (02:32 +0100)]
Update the documentation on heap allocators /  deallocators

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agoImplement the use of heap manipulator implementions
Richard Levitte [Wed, 17 Feb 2016 01:24:25 +0000 (02:24 +0100)]
Implement the use of heap manipulator implementions

- Make use of the functions given through CRYPTO_set_mem_functions().
- CRYPTO_free(), CRYPTO_clear_free() and CRYPTO_secure_free() now receive
  __FILE__ and __LINE__.
- The API for CRYPTO_set_mem_functions() and CRYPTO_get_mem_functions()
  is slightly changed, the implementation for free() now takes a couple
  of extra arguments, taking __FILE__ and __LINE__.
- The CRYPTO_ memory functions will *always* receive __FILE__ and __LINE__
  from the corresponding OPENSSL_ macros, regardless of if crypto-mdebug
  has been enabled or not.  The reason is that if someone swaps out the
  malloc(), realloc() and free() implementations, we can't know if they
  will use them or not.

Reviewed-by: Rich Salz <rsalz@openssl.org>
8 years agomd_rand: FAQ URL to use https and follow a redirect
Viktor Szakats [Tue, 16 Feb 2016 02:31:12 +0000 (03:31 +0100)]
md_rand: FAQ URL to use https and follow a redirect

Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoOPENSSL_init_ssl.pod: fix minor typo
Viktor Szakats [Mon, 15 Feb 2016 23:32:22 +0000 (00:32 +0100)]
OPENSSL_init_ssl.pod: fix minor typo
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoOn solaris, the variable name sun clashes, use s_un instead
Richard Levitte [Tue, 16 Feb 2016 09:27:16 +0000 (10:27 +0100)]
On solaris, the variable name sun clashes, use s_un instead

For orthogonality, we change sin -> s_in and sin6 -> s_in6 as well.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoCheck for OPENSSL_USE_APPLINK in $config{cflags} as well
Richard Levitte [Tue, 16 Feb 2016 15:49:29 +0000 (16:49 +0100)]
Check for OPENSSL_USE_APPLINK in $config{cflags} as well

Macro definitions "should" be found in $config{defines}, but some
configs haven't transfered macro definitions from their 'cflags'
settings (which isn't mandatory anyway), so check both places.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoDon't check for gcc or clang on VMS
Richard Levitte [Tue, 16 Feb 2016 15:08:06 +0000 (16:08 +0100)]
Don't check for gcc or clang on VMS

This check is meaningless on VMS and only produce an error because the
underlying shell (DCL) doesn't understand sh syntax such as '2>&1'.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoLowercase configuration arguments on VMS
Richard Levitte [Tue, 16 Feb 2016 15:07:05 +0000 (16:07 +0100)]
Lowercase configuration arguments on VMS

Depending on user preferences, Configure might get something like
--PREFIX=blah just as well as --prefix=blah, or "SHARED" just as well
as "shared".  On VMS, let's therefore lowercase at least the portion
of the argument before a possible equal sign.

For good measure, we lowercase the arguments to be checked in
config.com as well.  The original argument is sent on to Configure,
however.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoFix Solaris link_a and link_o
Richard Levitte [Tue, 16 Feb 2016 13:48:36 +0000 (14:48 +0100)]
Fix Solaris link_a and link_o

A long time ago, Solaris cc didn't seem to handle -Wl, linker options,
while gcc on Solaris required it.  Since then, Solaris cc has
developed to understand -Wl, options, and our little dance to figure
out how to pass linker options to the C compiler that's used isn't
needed any more.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoSimplify tls1_set_ec_id.
Dr. Stephen Henson [Sat, 13 Feb 2016 15:26:15 +0000 (15:26 +0000)]
Simplify tls1_set_ec_id.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoUse nid_list table to lookup curve IDs.
Dr. Stephen Henson [Sat, 13 Feb 2016 15:28:25 +0000 (15:28 +0000)]
Use nid_list table to lookup curve IDs.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAdd explanation and warning to TLS id table.
Dr. Stephen Henson [Sat, 13 Feb 2016 15:27:43 +0000 (15:27 +0000)]
Add explanation and warning to TLS id table.

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoFix use of add() and add_before() in Configurations/*.conf
Richard Levitte [Tue, 16 Feb 2016 01:48:18 +0000 (02:48 +0100)]
Fix use of add() and add_before() in Configurations/*.conf

These two functions take a separator to concatenat the strings with as
first argument.

Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
8 years agoPrepare for 1.1.0-pre4-dev
Richard Levitte [Mon, 15 Feb 2016 18:37:42 +0000 (19:37 +0100)]
Prepare for 1.1.0-pre4-dev

Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoPrepare for 1.1.0-pre3 release OpenSSL_1_1_0-pre3
Richard Levitte [Mon, 15 Feb 2016 18:37:20 +0000 (19:37 +0100)]
Prepare for 1.1.0-pre3 release

Reviewed-by: Stephen Henson <steve@openssl.org>
8 years agoCorrect deprecation of OPENSSL_config
Richard Levitte [Mon, 15 Feb 2016 15:14:46 +0000 (16:14 +0100)]
Correct deprecation of OPENSSL_config

Reported in GH#684

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoFix build-break
Rich Salz [Sun, 14 Feb 2016 21:23:27 +0000 (16:23 -0500)]
Fix build-break

Combination of heartbeats and unit-tests.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMANSUFFIX should be left empty
Richard Levitte [Mon, 15 Feb 2016 12:37:17 +0000 (13:37 +0100)]
MANSUFFIX should be left empty

That variable isn't for us, it's for any user, distributor or package
builder that wants one after the section number.  "ssl" seems to be
popular...

Reviewed-by: Matt Caswell <matt@openssl.org>
8 years agoAddress comments.
Ben Laurie [Sun, 14 Feb 2016 18:41:52 +0000 (18:41 +0000)]
Address comments.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoTests depend on everything.
Ben Laurie [Sun, 14 Feb 2016 05:32:19 +0000 (05:32 +0000)]
Tests depend on everything.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMake the BIO_ADDR param optional.
Rich Salz [Sun, 14 Feb 2016 20:50:13 +0000 (15:50 -0500)]
Make the BIO_ADDR param optional.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoMisc fixes in util/mk1mf.pl
Richard Levitte [Sun, 14 Feb 2016 21:06:49 +0000 (22:06 +0100)]
Misc fixes in util/mk1mf.pl

mk1mf was wondering about the options no-heartbeats and
no-crypto-mdebug-backtrace, so we add option hooks them.  They only
need to become OPENSSL_NO_ macros in opensslconf.h, so nothing
additional needs to be done.

Also, add "-DOPENSSL_PIC" when shared libraries are produced.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoDon't call cpuid in test; done as init.
Rich Salz [Sun, 14 Feb 2016 21:15:41 +0000 (16:15 -0500)]
Don't call cpuid in test; done as init.

Reviewed-by: Andy Polyakov <appro@openssl.org>
8 years agoFixes to make no-deprecated work again
Viktor Dukhovni [Sun, 14 Feb 2016 20:25:54 +0000 (15:25 -0500)]
Fixes to make no-deprecated work again

Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agoConfigurations/00-base-templates.conf: typos in [chacha|poly1305]_asm_src.
Andy Polyakov [Sat, 13 Feb 2016 16:44:45 +0000 (17:44 +0100)]
Configurations/00-base-templates.conf: typos in [chacha|poly1305]_asm_src.

Reviewed-by: Richard Levitte <levitte@openssl.org>
8 years agochacha/asm/chacha*: ensure that zero length is handled (without crash).
Andy Polyakov [Sat, 13 Feb 2016 16:13:53 +0000 (17:13 +0100)]
chacha/asm/chacha*: ensure that zero length is handled (without crash).

RT#4305

Reviewed-by: Rich Salz <rsalz@openssl.org>
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>