Commit graph

15440 commits

Author SHA1 Message Date
Richard Levitte
c8c2b77900 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>
2016-02-19 11:52:15 +01:00
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
24e75727bd 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>
2016-02-19 11:51:23 +01:00
Richard Levitte
e048fd5171 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>
2016-02-19 11:51:23 +01:00
Richard Levitte
f5c174ff93 Centralise the shared library / dso name info in unix-Makefile.tmpl
Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:51:23 +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
a8a421b113 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>
2016-02-19 11:14:06 +01:00
Richard Levitte
f0c93a8593 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>
2016-02-19 11:12:33 +01:00
Richard Levitte
8be7bdb5c6 Unified - do a better job when uninstalling
Some directories weren't removed.

Reviewed-by: Andy Polyakov <appro@openssl.org>
2016-02-19 11:12:33 +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
5be5e56c09 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>
2016-02-19 08:58:09 +01:00
Richard Levitte
70ef905779 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>
2016-02-19 08:57:59 +01:00
Richard Levitte
1576663231 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>
2016-02-19 02:32:22 +01:00
Richard Levitte
27f42b4679 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>
2016-02-19 02:30:51 +01:00
Richard Levitte
c058fcd798 Automatic '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>
2016-02-18 23:48:52 +01:00
Richard Levitte
df302cdce7 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>
2016-02-18 23:47:03 +01:00
Richard Levitte
f325fba50c 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>
2016-02-18 23:45:44 +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
Richard Levitte
88297284ad 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>
2016-02-18 23:42:09 +01:00
Richard Levitte
7d1037661a Fix the makedepend constructor in unix-Makefile.tmpl
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 23:41:29 +01:00
Rich Salz
d1776fdecd Fix {TLS,CIPHER}_DEBUG compiles.
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-18 17:19:32 -05:00
Roumen Petrov
6baa3b4305 documentation: RSA_new_method argument
Reviewed-by: Richard Levitte <levitte@openssl.org>
2016-02-18 17:16:42 -05: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
Roumen Petrov
1bd8bc558d remove redundant opt* declarations
Reviewed-by: Viktor Dukhovni <viktor@openssl.org>
2016-02-18 15:39:57 -05:00
Neel Goyal
37b6fd8371 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>
2016-02-18 14:12:19 -05:00
Rich Salz
9a13bb387d 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>
2016-02-18 12:24:44 -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
Matt Caswell
35b1a433ed 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>
2016-02-18 15:21:47 +00:00
Zhao Junwang
c4c32155f5 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>
2016-02-18 09:56:02 -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
Richard Levitte
29d0932721 Fix spelling
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:32:13 +01:00
Richard Levitte
6ba5dd341b Fix spelling
Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-18 00:11:18 +01:00
Richard Levitte
d9dc3e1d28 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>
2016-02-18 00:07:54 +01:00
David Woodhouse
3ba84717a0 Finish 02f7114a7f
Reviewed-by: Tim Hudson <tjh@openssl.org>
2016-02-17 17:04:47 -05:00
Richard Levitte
4277cf9091 Get conditional priorities right
"or" has lower priority than "||" and works better to have Perl less
confused.

Reviewed-by: Rich Salz <rsalz@openssl.org>
2016-02-17 22:23:09 +01:00
Richard Levitte
f9c693df45 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>
2016-02-17 22:11:55 +01:00
David Woodhouse
02f7114a7f 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>
2016-02-17 14:19:46 -05:00
Richard Levitte
95b2ebdf99 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>
2016-02-17 20:09:33 +01:00
Richard Levitte
d918f9cb2d 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>
2016-02-17 20:07:06 +01: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
Dr. Stephen Henson
c7c4625693 remove redundant code
Reviewed-by: Matt Caswell <matt@openssl.org>
2016-02-17 16:16:13 +00:00
David Woodhouse
21b80f9a12 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>
2016-02-17 10:39:35 -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
Richard Levitte
d6b55faca3 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>
2016-02-17 12:27:53 +01: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