summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorfireice-uk <fireice2@o2.pl>2017-03-14 20:31:23 +0000
committerfireice-uk <fireice2@o2.pl>2017-03-14 20:31:23 +0000
commit15bba85ef9af05dbb95ff32474d9937bbeae52ea (patch)
tree9c639e10c73be7b781133ae73169c3bb2ae8d389
parente4f5318768d1987056b156f7eb45596d80af19c3 (diff)
downloadxmr-stak-15bba85ef9af05dbb95ff32474d9937bbeae52ea.zip
xmr-stak-15bba85ef9af05dbb95ff32474d9937bbeae52ea.tar.gz
CONF_NO_TLS option
-rw-r--r--cli-miner.cpp4
-rw-r--r--jconf.cpp9
-rw-r--r--jpsock.cpp4
-rw-r--r--socket.cpp4
4 files changed, 21 insertions, 0 deletions
diff --git a/cli-miner.cpp b/cli-miner.cpp
index 5e19755..9eec369 100644
--- a/cli-miner.cpp
+++ b/cli-miner.cpp
@@ -32,8 +32,10 @@
#include <stdio.h>
#include <string.h>
+#ifndef CONF_NO_TLS
#include <openssl/ssl.h>
#include <openssl/err.h>
+#endif
//Do a press any key for the windows folk. *insert any key joke here*
#ifdef _WIN32
@@ -54,12 +56,14 @@ void do_benchmark();
int main(int argc, char *argv[])
{
+#ifndef CONF_NO_TLS
SSL_library_init();
SSL_load_error_strings();
ERR_load_BIO_strings();
ERR_load_crypto_strings();
SSL_load_error_strings();
OpenSSL_add_all_digests();
+#endif
const char* sFilename = "config.txt";
bool benchmark_mode = false;
diff --git a/jconf.cpp b/jconf.cpp
index 2b0a349..612065e 100644
--- a/jconf.cpp
+++ b/jconf.cpp
@@ -423,6 +423,15 @@ bool jconf::parse_config(const char* sFilename)
return false;
}
+#ifdef CONF_NO_TLS
+ if(prv->configValues[bTlsMode]->GetBool())
+ {
+ printer::inst()->print_msg(L0,
+ "Invalid config file. TLS enabled while the application has been compiled without TLS support.");
+ return false;
+ }
+#endif // CONF_NO_TLS
+
#ifdef _WIN32
if(GetSlowMemSetting() == no_mlck)
{
diff --git a/jpsock.cpp b/jpsock.cpp
index d90f0ef..7365727 100644
--- a/jpsock.cpp
+++ b/jpsock.cpp
@@ -103,10 +103,14 @@ jpsock::jpsock(size_t id, bool tls) : pool_id(id)
prv = new opaque_private(bJsonCallMem, bJsonRecvMem, bJsonParseMem);
+#ifndef CONF_NO_TLS
if(tls)
sck = new tls_socket(this);
else
sck = new plain_socket(this);
+#else
+ sck = new plain_socket(this);
+#endif
oRecvThd = nullptr;
bRunning = false;
diff --git a/socket.cpp b/socket.cpp
index b472feb..565eb76 100644
--- a/socket.cpp
+++ b/socket.cpp
@@ -27,6 +27,7 @@
#include "console.h"
#include "executor.h"
+#ifndef CONF_NO_TLS
#include <openssl/ssl.h>
#include <openssl/err.h>
#include <openssl/opensslconf.h>
@@ -34,6 +35,7 @@
#ifndef OPENSSL_THREADS
#error OpenSSL was compiled without thread support
#endif
+#endif
plain_socket::plain_socket(jpsock* err_callback) : pCallback(err_callback)
{
@@ -166,6 +168,7 @@ void plain_socket::close(bool free)
}
}
+#ifndef CONF_NO_TLS
tls_socket::tls_socket(jpsock* err_callback) : pCallback(err_callback)
{
}
@@ -355,4 +358,5 @@ void tls_socket::close(bool free)
bio = nullptr;
}
}
+#endif
OpenPOWER on IntegriCloud