diff options
author | Matt Caswell <matt@openssl.org> | 2016-05-19 20:11:09 +0100 |
---|---|---|
committer | Matt Caswell <matt@openssl.org> | 2016-05-20 23:08:18 +0100 |
commit | fcb318c64b8c3ff24ec36f99797880386bed5867 (patch) | |
tree | bcf69b03f51b62f326be4bd316dba29195f41ac7 /include/openssl | |
parent | 739a1eb1961cdc3b1597a040766f3cb359d095f6 (diff) | |
download | openssl-fcb318c64b8c3ff24ec36f99797880386bed5867.tar.gz |
Fix Windows 64 bit crashes
The function InitOnceExceuteOnce is the best way to support the
implementation of CRYPTO_THREAD_run_once() on Windows. Unfortunately
WinXP doesn't have it. To get around that we had two different
implementations: one for WinXP and one for later versions. Which one was
used was based on the value of _WIN32_WINNT.
This approach was starting to cause problems though because other parts of
OpenSSL assume _WIN32_WINNT is going to be 0x0501 and crashes were
occurring dependant on include file ordering. In addition a conditional
based on _WIN32_WINNT had made its way into a public header file through
commit 5c4328f. This is problematic because the value of this macro can
vary between OpenSSL build time and application build time.
The simplest solution to this mess is just to always use the WinXP version
of CRYPTO_THREAD_run_once(). Its perhaps slightly sub-optimal but probably
not noticably.
GitHub Issue #1086
Reviewed-by: Richard Levitte <levitte@openssl.org>
Diffstat (limited to 'include/openssl')
-rw-r--r-- | include/openssl/crypto.h | 7 |
1 files changed, 1 insertions, 6 deletions
diff --git a/include/openssl/crypto.h b/include/openssl/crypto.h index 1162c71041..84c479cc3c 100644 --- a/include/openssl/crypto.h +++ b/include/openssl/crypto.h @@ -396,13 +396,8 @@ typedef unsigned int CRYPTO_THREAD_ID; typedef DWORD CRYPTO_THREAD_LOCAL; typedef DWORD CRYPTO_THREAD_ID; -# if _WIN32_WINNT < 0x0600 typedef LONG CRYPTO_ONCE; -# define CRYPTO_ONCE_STATIC_INIT 0 -# else -typedef INIT_ONCE CRYPTO_ONCE; -# define CRYPTO_ONCE_STATIC_INIT INIT_ONCE_STATIC_INIT -# endif +# define CRYPTO_ONCE_STATIC_INIT 0 # else # include <pthread.h> |