Commit graph

7543 commits

Author SHA1 Message Date
Richard Levitte
9ee0ed3de6 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>
2016-02-19 11:52:15 +01:00
Richard Levitte
e987f9f271 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>
2016-02-19 11:51:23 +01:00
Richard Levitte
3a55c92bba 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>
2016-02-19 11:06:54 +01:00
Richard Levitte
ce192ebed0 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>
2016-02-18 23:43:09 +01:00
Rich Salz
d63a5e5e7d 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>
2016-02-18 17:14:50 -05:00
Matt Caswell
6bc7bad011 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>
2016-02-18 15:27:16 +00:00
Roumen Petrov
4015adf0a3 Fix OPENSSL_config with NULL parameter
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-18 10:25:23 -05:00
Dr. Stephen Henson
f6fb7f1856 typo
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 13:59:18 +00:00
Rich Salz
e4ef2e25f1 Remove "experimental" in code and comments, too.
Thanks to Viktor for additional review.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-17 21:12:30 -05:00
Richard Levitte
4418e0302f In the unified scheme, there is no $(TOP), use $(SRCDIR) instead
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:38:26 +01:00
David Woodhouse
3ba84717a0 Finish 02f7114a7f
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-17 17:04:47 -05:00
Rich Salz
1288f26fb9 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>
2016-02-17 13:33:51 -05:00
David Woodhouse
c7b7938e75 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>
2016-02-17 10:07:30 -05:00
Rich Salz
dba3177745 Remove JPAKE
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-17 09:46:10 -05:00
David Woodhouse
6a78ae2821 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>
2016-02-17 09:16:01 -05:00
Dmitry-Me
9eaa5f9a32 Fix mismatched curly brace
Reviewed-by: Matt Caswell <matt@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-17 11:06:47 +01:00
Richard Levitte
05c7b1631b 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>
2016-02-17 10:12:49 +01:00
Viktor Szakats
e159fd1543 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>
2016-02-16 16:51:13 -05:00
Richard Levitte
29620124ff 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>
2016-02-16 17:16:32 +01:00
Rich Salz
d9d8e7a9c1 Make the BIO_ADDR param optional.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14 17:36:10 -05:00
Viktor Dukhovni
31305cdf9f Fixes to make no-deprecated work again
Reviewed-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-14 16:16:08 -05:00
Andy Polyakov
622a531c18 chacha/asm/chacha*: ensure that zero length is handled (without crash).
RT#4305

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-14 21:22:42 +01:00
Andy Polyakov
29880e9710 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>
2016-02-14 21:03:10 +01:00
Richard Levitte
ef8ca6bd54 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>
2016-02-14 17:22:42 +01:00
Richard Levitte
dda71111b8 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>
2016-02-14 14:13:53 +01:00
Richard Levitte
59d9bb591c 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>
2016-02-14 11:16:37 +01:00
Andy Polyakov
c8d1c9b067 crypto/poly1305: add floating-point reference implementation.
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-13 21:59:02 +01:00
Richard Levitte
de72be2e57 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>
2016-02-13 19:21:36 +01:00
Andy Polyakov
b3214008e4 Configurations: engage PPC ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 17:22:20 +01:00
Andy Polyakov
9e58d1192d PPC assembly pack: add ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 17:21:47 +01:00
Viktor Szakats
1b3cddff2b 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>
2016-02-13 09:36:59 -05:00
Dmitry-Me
33a6d5a0e5 GH643: Cleanup header analysis
Signed-off-by: Rich Salz <rsalz@openssl.org>
Reviewed-by: Kurt Roeckx <kurt@openssl.org>
2016-02-13 08:21:09 -05:00
Andy Polyakov
f4e175e4af C64x+ assembly pack: add ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 12:34:29 +01:00
Andy Polyakov
1fdcef75b0 ARM assembly pack: add ChaCha20 and Poly1305 modules.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 12:07:45 +01:00
Rob Percival
e634b448c3 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>
2016-02-13 10:22:54 +00:00
Viktor Dukhovni
ce3d25d3e5 Fix some issues near recent chomp changes.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-13 02:54:48 -05:00
Andy Polyakov
7687f52550 evp/e_des[3].c: address compiler warnings, fix formatting.
RT#4210

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-12 22:09:04 +01:00
Andy Polyakov
5e4bbeb49f 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>
2016-02-12 21:57:43 +01:00
Richard Levitte
3c65577f1a 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>
2016-02-12 21:54:07 +01:00
Andy Polyakov
577583519b ec/asm/ecp_nistz256-armv8.pl: fix test_ssl spurious errors.
RT#4237

Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-12 21:41:21 +01:00
Richard Levitte
6faffd0ad2 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>
2016-02-12 19:50:46 +01:00
Dr. Stephen Henson
b3ca51559b Typo: only return error if unrecognise bag type.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-11 23:27:30 +00:00
Richard Levitte
9ba96fbb25 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>
2016-02-11 22:11:48 +01:00
Andy Polyakov
fd7dc201d3 perlasm/x86_64-xlate.pl: pass pure constants verbatim.
RT#3885

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-11 21:07:44 +01:00
Andy Polyakov
4ef29667ab poly1305/asm/poly1305-x86_64.pl: MacOS X portability fix.
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-11 20:47:33 +01:00
Andy Polyakov
a85dbf115c poly1305/asm/poly1305-x86_64.pl: fix mingw64 build.
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-11 20:47:01 +01:00
Rich Salz
f3f1cf8444 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>
2016-02-11 12:40:32 -05:00
Rich Salz
84c15091ec Fix GH 327.
Valgrind complains about using unitialized memory.  So call
OPENSSL_zalloc, not malloc.

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11 12:13:18 -05:00
Rich Salz
27f172d9a3 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>
2016-02-11 09:33:51 -05:00
Rich Salz
143e5e50f2 Check malloc
Noticed by Claus Assmann <ca+ssl-dev@esmtp.org>

Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-11 09:21:35 -05:00