Richard Levitte [Sat, 12 Mar 2016 00:06:48 +0000 (01:06 +0100)]
Avoid sed for dependency post-processing
It turns out that different sed implementations treat -i differently
to cause issues. make it simpler by avoiding it entirely and give
perl the trust to be consistent enough.
Matt Caswell [Fri, 11 Mar 2016 16:47:42 +0000 (16:47 +0000)]
Don't clobber the last error
On Windows we call WSAGetLastError() to find out the last error that
happened on a socket operation. We use this to find out whether we can
retry the operation or not. You are supposed to call this immediately
however in a couple of places we logged an error first. This can end up
making other Windows system calls to get the thread local error state.
Sometimes that can clobber the error code, so if you call WSAGetLastError()
later on you get a spurious response and the socket operation looks like
a fatal error.
Really we shouldn't be logging an error anyway if its a retryable issue.
Otherwise we could end up with stale errors on the error queue.
Reviewed-by: Richard Levitte <levitte@openssl.org>
If pre-processor failed, an empty .s file could be left behind,
which could get successfully compiled if one simply re-ran make
and cause linking failures. Not anymore. Remove even intermediate .S
in case of pre-processor failure.
Reviewed-by: Richard Levitte <levitte@openssl.org>
Matt Caswell [Fri, 11 Mar 2016 09:52:52 +0000 (09:52 +0000)]
Call CONF_modules_free() before ENGINE_cleanup() in auto-deinit
During auto de-init we were calling ENGINE_cleanup(), and then later
CONF_modules_free(). However the latter function can end up calling
engine code, which can lead to a use of the global_engine_lock after it
has already been freed. Therefore we should swap the calling order of
these two functions.
Mat [Fri, 11 Mar 2016 03:52:32 +0000 (04:52 +0100)]
Fix no-rmd160 classic Windows build
no-ripemd was unified a while ago but the change was not done in mk1mf.pl. This commit changes the no-ripemd string to no-rmd160 which fixes the no-rmd160 classic build. Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Richard Levitte [Fri, 11 Mar 2016 08:26:49 +0000 (09:26 +0100)]
Harmonise the two methods to generate dependency files
One of them didn't clean away .d.tmp files properly.
The other would overwrite the .d files unconditionally, thereby
causing a possibly unnecessary dependency rebuild, which touches the
date of Makefile, which causes a possibly unnecessary rebuild of
buildinf.h and everything that depends on that.
Richard Levitte [Thu, 10 Mar 2016 23:49:47 +0000 (00:49 +0100)]
Fix some assembler generating scripts for better unification
Some of these scripts would recognise an output parameter if it looks
like a file path. That works both in both the classic and new build
schemes. Some fo these scripts would only recognise it if it's a
basename (i.e. no directory component). Those need to be corrected,
as the output parameter in the new build scheme is more likely to
contain a directory component than not.
Richard Levitte [Thu, 10 Mar 2016 13:20:50 +0000 (14:20 +0100)]
Harmonize the option processing in 'config' and 'config.com'
The help text for -d in 'config' was aged, and the option processing
in 'config.com' was just different. This harmonizes 'config.com' with
the instructions in INSTALL and both current reality.
David Woodhouse [Sat, 20 Feb 2016 15:07:32 +0000 (15:07 +0000)]
Allow OPENSSL_NO_SOCK in e_os.h even for non-Windows/DOS platforms
UEFI needs this too. Don't keep it only in the Windows/DOS ifdef block.
This is a fixed version of what was originally commit 963bb62195 and
subsequently reverted in commit 37b1f8bd62. Somewhere along the way, the
Windows/DOS ifdef actually got removed, leaving it just broken. It should
have been turned into an #elif, not removed.
This one correctly changes the logic from
# if WINDOWS|DOS
# if OPENSSL_NO_SOCK
... no-sock ...
# elif !DJGPP
... native windows ...
to
# if OPENSSL_NO_SOCK
... no-sock ...
# elif WINDOWS|DOS
# if !DJGPP
... native windows ...
Reviewed-by: Rich Salz <rsalz@openssl.org> Reviewed-by: Richard Levitte <levitte@openssl.org>
Richard Levitte [Thu, 10 Mar 2016 08:04:09 +0000 (09:04 +0100)]
Pass down inclusion directories to source file generators
The source file generators sometimes use $(CC) to post-process
generated source, and getting the inclusion directories may be
necessary at times, so we pass them down.
Richard Levitte [Thu, 10 Mar 2016 01:14:55 +0000 (02:14 +0100)]
Travis - don't use ccache with cross compiles
Although theoretically possible, Configure doesn't treat CC variable
set like this very well: CC="ccache i686-w64-mingw32-gcc"
Also, this Travis script doesn't recognise the possibility either.
Benjamin Kaduk [Tue, 8 Mar 2016 22:44:57 +0000 (16:44 -0600)]
Avoid negative array index in BIO_debug_callback()
BIO_snprintf() can return -1 on truncation (and overflow as of commit 9cb177301fdab492e4cfef376b28339afe3ef663). Though neither can
realistically occur while printing a pointer and short fixed string into
a buffer of length 256, the analysis to confirm that this the case goes
somewhat far up the call chain, and not all static analyzers can
successfully follow the chain of logic.
It's easy enough to clamp the returned length to be nonnegative before
continuing, which appeases the static analyzer and does not harm the
subsequent code.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Benjamin Kaduk [Tue, 8 Mar 2016 21:53:49 +0000 (15:53 -0600)]
CT: check some GeneralizedTime return values
Some of the ASN.1 routines for the GeneralizedTime type can return
errors; check for these and do not continue past failure, so as
to appease coverity.
Reviewed-by: Richard Levitte <levitte@openssl.org> Reviewed-by: Rich Salz <rsalz@openssl.org>
Richard Levitte [Thu, 10 Mar 2016 00:58:27 +0000 (01:58 +0100)]
When configured "shared", don't build static libraries on Windows
The reason for this is that the static libraries and the DLL import
libraries are named the same on Windows. When configured "shared",
the static libraries are unused anyway.
Richard Levitte [Wed, 9 Mar 2016 16:18:07 +0000 (17:18 +0100)]
Comment away the extra checks in Configure
The "extra checks" is a debugging tool to check the config resolving
mechanism. It uses Perl's smart match, which is experimental and
therefore always causes Perl to give out a warning, and it causes
older Perl versions to fail entirely.
So, it gets commented away, but stays otherwise in place, as it may be
useful again.
Richard Levitte [Wed, 9 Mar 2016 13:10:05 +0000 (14:10 +0100)]
Fix ct_test to not assume it's in the source directory
ct_test assumed it's run in the source directory and failed when built
elsewhere. It still defaults to that, but can be told another story
with the environment variables CT_DIR and CERTS_DIR.