diff options
| author | Aaron Spike <aaron@ekips.org> | 2007-01-07 17:51:26 +0000 |
|---|---|---|
| committer | acspike <acspike@users.sourceforge.net> | 2007-01-07 17:51:26 +0000 |
| commit | c60711a69ed0684b08835bc372b566bcd7d70f2b (patch) | |
| tree | e3ab5dc70fe821039e542fd3b2e1fff035e35aec /src | |
| parent | Fixed crash when doing a boolean union when nothing is selected. (diff) | |
| download | inkscape-c60711a69ed0684b08835bc372b566bcd7d70f2b.tar.gz inkscape-c60711a69ed0684b08835bc372b566bcd7d70f2b.zip | |
use relaytool to weak link libssl
(bzr r2146)
Diffstat (limited to 'src')
| -rw-r--r-- | src/dom/io/socket.cpp | 35 | ||||
| -rw-r--r-- | src/pedro/pedroutil.cpp | 39 |
2 files changed, 65 insertions, 9 deletions
diff --git a/src/dom/io/socket.cpp b/src/dom/io/socket.cpp index 31eeb56ba..22b03b8b3 100644 --- a/src/dom/io/socket.cpp +++ b/src/dom/io/socket.cpp @@ -53,6 +53,8 @@ #ifdef HAVE_SSL #include <openssl/ssl.h> #include <openssl/err.h> + +RELAYTOOL_SSL #endif @@ -205,12 +207,15 @@ void TcpSocket::init() WSAStartup( wVersionRequested, &wsaData ); #endif #ifdef HAVE_SSL - sslStream = NULL; - sslContext = NULL; + if (libssl_is_present) + { + sslStream = NULL; + sslContext = NULL; CRYPTO_set_locking_callback(cryptoLockCallback); - CRYPTO_set_id_callback(cryptoIdCallback); - SSL_library_init(); - SSL_load_error_strings(); + CRYPTO_set_id_callback(cryptoIdCallback); + SSL_library_init(); + SSL_load_error_strings(); + } #endif tcp_socket_inited = true; } @@ -285,6 +290,8 @@ static void infoCallback(const SSL *ssl, int where, int ret) bool TcpSocket::startTls() { #ifdef HAVE_SSL + if (libssl_is_present) + { sslStream = NULL; sslContext = NULL; @@ -335,6 +342,7 @@ bool TcpSocket::startTls() } sslEnabled = true; + } #endif /*HAVE_SSL*/ return true; } @@ -397,6 +405,8 @@ bool TcpSocket::disconnect() bool ret = true; connected = false; #ifdef HAVE_SSL + if (libssl_is_present) + { if (sslEnabled) { if (sslStream) @@ -419,6 +429,7 @@ bool TcpSocket::disconnect() } sslStream = NULL; sslContext = NULL; + } #endif /*HAVE_SSL*/ #ifdef __WIN32__ @@ -460,7 +471,10 @@ long TcpSocket::available() if (count<=0 && sslEnabled) { #ifdef HAVE_SSL - return SSL_pending(sslStream); + if (libssl_is_present) + { + return SSL_pending(sslStream); + } #endif } return count; @@ -480,6 +494,8 @@ bool TcpSocket::write(int ch) if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { int r = SSL_write(sslStream, &c, 1); if (r<=0) { @@ -490,6 +506,7 @@ bool TcpSocket::write(int ch) return -1; } } + } #endif } else @@ -518,6 +535,8 @@ bool TcpSocket::write(const DOMString &strArg) if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { int r = SSL_write(sslStream, (unsigned char *)str.c_str(), len); if (r<=0) { @@ -528,6 +547,7 @@ bool TcpSocket::write(const DOMString &strArg) return -1; } } + } #endif } else @@ -572,6 +592,8 @@ int TcpSocket::read() if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { if (!sslStream) return -1; int r = SSL_read(sslStream, &ch, 1); @@ -591,6 +613,7 @@ int TcpSocket::read() ERR_error_string(ERR_get_error(), NULL)); return -1; } + } #endif } else diff --git a/src/pedro/pedroutil.cpp b/src/pedro/pedroutil.cpp index e08bed0a6..13577bf8f 100644 --- a/src/pedro/pedroutil.cpp +++ b/src/pedro/pedroutil.cpp @@ -48,6 +48,9 @@ #endif /* UNIX */ +#ifdef HAVE_SSL +RELAYTOOL_SSL +#endif namespace Pedro @@ -995,12 +998,15 @@ void TcpSocket::init() WSAStartup( wVersionRequested, &wsaData ); #endif #ifdef HAVE_SSL + if (libssl_is_present) + { sslStream = NULL; sslContext = NULL; CRYPTO_set_locking_callback(cryptoLockCallback); CRYPTO_set_id_callback(cryptoIdCallback); SSL_library_init(); SSL_load_error_strings(); + } #endif tcp_socket_inited = true; } @@ -1027,7 +1033,12 @@ bool TcpSocket::isConnected() bool TcpSocket::getHaveSSL() { #ifdef HAVE_SSL - return true; + if (libssl_is_present) + { + return true; + } else { + return false; + } #else return false; #endif @@ -1094,7 +1105,13 @@ bool TcpSocket::startTls() "SSL starttls() error: client not compiled with SSL enabled\n"); return false; #else /*HAVE_SSL*/ - + if (!libssl_is_present) + { + fprintf(stderr, + "SSL starttls() error: the correct version of libssl was not found \n"); + return false; + } else { + sslStream = NULL; sslContext = NULL; @@ -1157,6 +1174,7 @@ bool TcpSocket::startTls() sslEnabled = true; return true; + } #endif /* HAVE_SSL */ } @@ -1218,6 +1236,8 @@ bool TcpSocket::disconnect() bool ret = true; connected = false; #ifdef HAVE_SSL + if (libssl_is_present) + { if (sslEnabled) { if (sslStream) @@ -1240,6 +1260,7 @@ bool TcpSocket::disconnect() } sslStream = NULL; sslContext = NULL; + } #endif /*HAVE_SSL*/ #ifdef __WIN32__ @@ -1281,7 +1302,10 @@ long TcpSocket::available() if (count<=0 && sslEnabled) { #ifdef HAVE_SSL - return SSL_pending(sslStream); + if (libssl_is_present) + { + return SSL_pending(sslStream); + } #endif } return count; @@ -1301,6 +1325,8 @@ bool TcpSocket::write(int ch) if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { int r = SSL_write(sslStream, &c, 1); if (r<=0) { @@ -1311,6 +1337,7 @@ bool TcpSocket::write(int ch) return -1; } } + } #endif } else @@ -1337,6 +1364,8 @@ bool TcpSocket::write(char *str) if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { int r = SSL_write(sslStream, (unsigned char *)str, len); if (r<=0) { @@ -1347,6 +1376,7 @@ bool TcpSocket::write(char *str) return -1; } } + } #endif } else @@ -1396,6 +1426,8 @@ int TcpSocket::read() if (sslEnabled) { #ifdef HAVE_SSL + if (libssl_is_present) + { if (!sslStream) return -1; int r = SSL_read(sslStream, &ch, 1); @@ -1415,6 +1447,7 @@ int TcpSocket::read() ERR_error_string(ERR_get_error(), NULL)); return -1; } + } #endif } else |
