summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-02-18 22:43:50 +0900
committerTatsuhiro Tsujikawa <tatsuhiro.t@gmail.com>2011-02-18 22:43:50 +0900
commit395212f47f5ce74edb7ca9b31df72b201423b3f3 (patch)
tree45ccdc007918cf246386820cf8a7a5496b5a1782 /src
parent7230fbd2f780023b269fc940a286cd064fbe98b2 (diff)
Replaced HAVE_LIBSSL with HAVE_OPENSSL
Diffstat (limited to 'src')
-rw-r--r--src/ARC4Decryptor.h2
-rw-r--r--src/ARC4Encryptor.h2
-rw-r--r--src/DHKeyExchange.h4
-rw-r--r--src/Makefile.am4
-rw-r--r--src/MessageDigestImpl.h4
-rw-r--r--src/Platform.cc8
-rw-r--r--src/SocketCore.cc32
-rw-r--r--src/SocketCore.h8
-rw-r--r--src/TLSContext.h2
-rw-r--r--src/util.cc8
10 files changed, 37 insertions, 37 deletions
diff --git a/src/ARC4Decryptor.h b/src/ARC4Decryptor.h
index 32714f3f..20254c31 100644
--- a/src/ARC4Decryptor.h
+++ b/src/ARC4Decryptor.h
@@ -38,7 +38,7 @@
#include "common.h"
#ifdef HAVE_LIBGCRYPT
# include "LibgcryptARC4Decryptor.h"
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
# include "LibsslARC4Decryptor.h"
#else
diff --git a/src/ARC4Encryptor.h b/src/ARC4Encryptor.h
index f3437d97..84a0f049 100644
--- a/src/ARC4Encryptor.h
+++ b/src/ARC4Encryptor.h
@@ -38,7 +38,7 @@
#include "common.h"
#ifdef HAVE_LIBGCRYPT
# include "LibgcryptARC4Encryptor.h"
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
# include "LibsslARC4Encryptor.h"
#else
diff --git a/src/DHKeyExchange.h b/src/DHKeyExchange.h
index fbabc7af..91e12ff0 100644
--- a/src/DHKeyExchange.h
+++ b/src/DHKeyExchange.h
@@ -38,8 +38,8 @@
#include "common.h"
#ifdef HAVE_LIBGCRYPT
# include "LibgcryptDHKeyExchange.h"
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
# include "LibsslDHKeyExchange.h"
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#endif // D_DH_KEY_EXCHANGE_H
diff --git a/src/Makefile.am b/src/Makefile.am
index 83a57781..05cb27c4 100644
--- a/src/Makefile.am
+++ b/src/Makefile.am
@@ -261,14 +261,14 @@ SRCS += LibgnutlsTLSContext.cc LibgnutlsTLSContext.h\
LibgcryptDHKeyExchange.cc LibgcryptDHKeyExchange.h
endif # HAVE_LIBGNUTLS
-if HAVE_LIBSSL
+if HAVE_OPENSSL
SRCS += LibsslTLSContext.cc LibsslTLSContext.h\
LibsslMessageDigestImpl.cc LibsslMessageDigestImpl.h\
LibsslARC4Context.cc LibsslARC4Context.h\
LibsslARC4Decryptor.cc LibsslARC4Decryptor.h\
LibsslARC4Encryptor.cc LibsslARC4Encryptor.h\
LibsslDHKeyExchange.cc LibsslDHKeyExchange.h
-endif # HAVE_LIBSSL
+endif # HAVE_OPENSSL
if HAVE_ZLIB
SRCS += GZipDecoder.cc GZipDecoder.h\
diff --git a/src/MessageDigestImpl.h b/src/MessageDigestImpl.h
index a7892daa..91a901d6 100644
--- a/src/MessageDigestImpl.h
+++ b/src/MessageDigestImpl.h
@@ -37,8 +37,8 @@
#ifdef HAVE_LIBGCRYPT
# include "LibgcryptMessageDigestImpl.h"
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
# include "LibsslMessageDigestImpl.h"
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#endif // D_MESSAGE_DIGEST_IMPL_H
diff --git a/src/Platform.cc b/src/Platform.cc
index 57638f92..151b40ef 100644
--- a/src/Platform.cc
+++ b/src/Platform.cc
@@ -54,10 +54,10 @@
#endif // HAVE_WINSOCK2_H
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
# include <openssl/err.h>
# include <openssl/ssl.h>
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
# include <gnutls/gnutls.h>
#endif // HAVE_LIBGNUTLS
@@ -97,11 +97,11 @@ bool Platform::setUp()
textdomain (PACKAGE);
#endif // ENABLE_NLS
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL initialization
SSL_load_error_strings();
SSL_library_init();
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
gnutls_global_init();
#endif // HAVE_LIBGNUTLS
diff --git a/src/SocketCore.cc b/src/SocketCore.cc
index dcd5d676..cf4693bf 100644
--- a/src/SocketCore.cc
+++ b/src/SocketCore.cc
@@ -152,10 +152,10 @@ void SocketCore::init()
wantRead_ = false;
wantWrite_ = false;
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
ssl = NULL;
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
sslSession_ = 0;
#endif //HAVE_LIBGNUTLS
@@ -554,12 +554,12 @@ void SocketCore::setBlockingMode()
void SocketCore::closeConnection()
{
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
if(secure_) {
SSL_shutdown(ssl);
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
if(secure_) {
gnutls_bye(sslSession_, GNUTLS_SHUT_RDWR);
@@ -569,12 +569,12 @@ void SocketCore::closeConnection()
CLOSE(sockfd_);
sockfd_ = -1;
}
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
if(secure_) {
SSL_free(ssl);
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
if(secure_) {
gnutls_deinit(sslSession_);
@@ -685,7 +685,7 @@ bool SocketCore::isReadable(time_t timeout)
#endif // !HAVE_POLL
}
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
int SocketCore::sslHandleEAGAIN(int ret)
{
int error = SSL_get_error(ssl, ret);
@@ -699,7 +699,7 @@ int SocketCore::sslHandleEAGAIN(int ret)
}
return ret;
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
void SocketCore::gnutlsRecordCheckDirection()
@@ -731,7 +731,7 @@ ssize_t SocketCore::writeData(const char* data, size_t len)
}
}
} else {
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
ret = SSL_write(ssl, data, len);
if(ret < 0) {
ret = sslHandleEAGAIN(ret);
@@ -741,7 +741,7 @@ ssize_t SocketCore::writeData(const char* data, size_t len)
(fmt(EX_SOCKET_SEND,
ERR_error_string(SSL_get_error(ssl, ret), 0)));
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
while((ret = gnutls_record_send(sslSession_, data, len)) ==
GNUTLS_E_INTERRUPTED);
@@ -776,7 +776,7 @@ void SocketCore::readData(char* data, size_t& len)
}
}
} else {
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
// TODO handling len == 0 case required
ret = SSL_read(ssl, data, len);
@@ -788,7 +788,7 @@ void SocketCore::readData(char* data, size_t& len)
(fmt(EX_SOCKET_RECV,
ERR_error_string(SSL_get_error(ssl, ret), 0)));
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
while((ret = gnutls_record_recv(sslSession_, data, len)) ==
GNUTLS_E_INTERRUPTED);
@@ -807,7 +807,7 @@ void SocketCore::readData(char* data, size_t& len)
void SocketCore::prepareSecureConnection()
{
if(!secure_) {
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
ssl = SSL_new(tlsContext_->getSSLCtx());
if(!ssl) {
@@ -820,7 +820,7 @@ void SocketCore::prepareSecureConnection()
(fmt(EX_SSL_INIT_FAILURE,
ERR_error_string(ERR_get_error(), 0)));
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
int r;
gnutls_init(&sslSession_, GNUTLS_CLIENT);
@@ -847,7 +847,7 @@ bool SocketCore::initiateSecureConnection(const std::string& hostname)
if(secure_ == 1) {
wantRead_ = false;
wantWrite_ = false;
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
int e = SSL_connect(ssl);
if (e <= 0) {
@@ -922,7 +922,7 @@ bool SocketCore::initiateSecureConnection(const std::string& hostname)
throw DL_ABORT_EX(MSG_HOSTNAME_NOT_MATCH);
}
}
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
int ret = gnutls_handshake(sslSession_);
if(ret == GNUTLS_E_AGAIN) {
diff --git a/src/SocketCore.h b/src/SocketCore.h
index bbf01ea7..2df3efe6 100644
--- a/src/SocketCore.h
+++ b/src/SocketCore.h
@@ -44,11 +44,11 @@
#include "a2netcompat.h"
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
# include <openssl/ssl.h>
# include <openssl/err.h>
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
# include <gnutls/gnutls.h>
#endif // HAVE_LIBGNUTLS
@@ -88,12 +88,12 @@ private:
static SharedHandle<TLSContext> tlsContext_;
#endif // ENABLE_SSL
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
// for SSL
SSL* ssl;
int sslHandleEAGAIN(int ret);
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#ifdef HAVE_LIBGNUTLS
gnutls_session_t sslSession_;
diff --git a/src/TLSContext.h b/src/TLSContext.h
index 9a3f509b..f3832b4f 100644
--- a/src/TLSContext.h
+++ b/src/TLSContext.h
@@ -37,7 +37,7 @@
#include "common.h"
-#ifdef HAVE_LIBSSL
+#ifdef HAVE_OPENSSL
# include "LibsslTLSContext.h"
#elif HAVE_LIBGNUTLS
# include "LibgnutlsTLSContext.h"
diff --git a/src/util.cc b/src/util.cc
index 382f2cff..e4656e29 100644
--- a/src/util.cc
+++ b/src/util.cc
@@ -57,10 +57,10 @@
#ifdef HAVE_LIBGCRYPT
# include <gcrypt.h>
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
# include <openssl/rand.h>
# include "SimpleRandomizer.h"
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
#include "File.h"
#include "message.h"
@@ -1285,7 +1285,7 @@ void generateRandomData(unsigned char* data, size_t length)
{
#ifdef HAVE_LIBGCRYPT
gcry_randomize(data, length, GCRY_STRONG_RANDOM);
-#elif HAVE_LIBSSL
+#elif HAVE_OPENSSL
if(RAND_bytes(data, length) != 1) {
for(size_t i = 0; i < length; ++i) {
data[i] = SimpleRandomizer::getInstance()->getRandomNumber(UINT8_MAX+1);
@@ -1294,7 +1294,7 @@ void generateRandomData(unsigned char* data, size_t length)
#else
std::ifstream i("/dev/urandom", std::ios::binary);
i.read(reinterpret_cast<char*>(data), length);
-#endif // HAVE_LIBSSL
+#endif // HAVE_OPENSSL
}
bool saveAs