From 0b7bf3585a378bca4fc5bb551af3c37d517fdf28 Mon Sep 17 00:00:00 2001 From: Nick Mathewson Date: Thu, 21 May 2015 11:54:13 -0400 Subject: Generate error ASAP if building with too-old openssl --- src/common/aes.c | 7 ++++++- src/common/crypto.c | 16 +++++++++------- src/common/tortls.c | 13 +++++++------ 3 files changed, 22 insertions(+), 14 deletions(-) (limited to 'src/common') diff --git a/src/common/aes.c b/src/common/aes.c index 201cadc741..dbc12dcd23 100644 --- a/src/common/aes.c +++ b/src/common/aes.c @@ -25,13 +25,18 @@ #endif #include +#include "crypto.h" + +#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0) +#error "We require OpenSSL >= 1.0.0" +#endif + #include #include #include #include #include #include -#include "crypto.h" #include #include "compat.h" #include "aes.h" diff --git a/src/common/crypto.c b/src/common/crypto.c index 28963f52cb..fcd862f045 100644 --- a/src/common/crypto.c +++ b/src/common/crypto.c @@ -24,13 +24,21 @@ #undef OCSP_RESPONSE #endif +#include + +#define CRYPTO_PRIVATE +#include "crypto.h" + +#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0) +#error "We require OpenSSL >= 1.0.0" +#endif + #include #include #include #include #include #include -#include #include #include #include @@ -49,8 +57,6 @@ #include #endif -#define CRYPTO_PRIVATE -#include "crypto.h" #include "torlog.h" #include "aes.h" #include "util.h" @@ -58,10 +64,6 @@ #include "compat.h" #include "sandbox.h" -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0) -#error "We require OpenSSL >= 1.0.0" -#endif - #ifdef ANDROID /* Android's OpenSSL seems to have removed all of its Engine support. */ #define DISABLE_ENGINES diff --git a/src/common/tortls.c b/src/common/tortls.c index ca3291b499..ca7b15fcd7 100644 --- a/src/common/tortls.c +++ b/src/common/tortls.c @@ -43,13 +43,19 @@ #pragma GCC diagnostic ignored "-Wredundant-decls" #endif +#include +#include "crypto.h" + +#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0) +#error "We require OpenSSL >= 1.0.0" +#endif + #include #include #include #include #include #include -#include #include #include @@ -68,17 +74,12 @@ #include "compat_libevent.h" #endif -#include "crypto.h" #include "tortls.h" #include "util.h" #include "torlog.h" #include "container.h" #include -#if OPENSSL_VERSION_NUMBER < OPENSSL_V_SERIES(1,0,0) -#error "We require OpenSSL >= 1.0.0" -#endif - /* Enable the "v2" TLS handshake. */ #define V2_HANDSHAKE_SERVER -- cgit v1.2.3-54-g00ecf