index 6d988c719a7844a109e1e6033d3c21ad8d0f6af8..13577bf8f716dd1bf99c57492fe7886a08ef5442 100644 (file)
--- a/src/pedro/pedroutil.cpp
+++ b/src/pedro/pedroutil.cpp
#endif /* UNIX */
+#ifdef HAVE_SSL
+RELAYTOOL_SSL
+#endif
namespace Pedro
append((unsigned char *)str.c_str(), str.size());
}
+/*
+ * Update context to reflect the concatenation of a single character
+ */
+void Md5::append(unsigned char ch)
+{
+ append(&ch, 1);
+}
+
/*
* Final wrapup - pad to 64-byte boundary with the bit pattern
* 1 0* (64-bit count of bits processed, MSB-first)
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;
}
bool TcpSocket::getHaveSSL()
{
#ifdef HAVE_SSL
- return true;
+ if (libssl_is_present)
+ {
+ return true;
+ } else {
+ return false;
+ }
#else
return false;
#endif
fprintf(stderr,
"SSL starttls() error: client not compiled with SSL enabled\n");
return false;
-#endif /*HAVE_SSL*/
-
+#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;
sslEnabled = true;
return true;
+ }
+#endif /* HAVE_SSL */
}
bool ret = true;
connected = false;
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (sslEnabled)
{
if (sslStream)
}
sslStream = NULL;
sslContext = NULL;
+ }
#endif /*HAVE_SSL*/
#ifdef __WIN32__
if (count<=0 && sslEnabled)
{
#ifdef HAVE_SSL
- return SSL_pending(sslStream);
+ if (libssl_is_present)
+ {
+ return SSL_pending(sslStream);
+ }
#endif
}
return count;
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, &c, 1);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
int r = SSL_write(sslStream, (unsigned char *)str, len);
if (r<=0)
{
return -1;
}
}
+ }
#endif
}
else
if (sslEnabled)
{
#ifdef HAVE_SSL
+ if (libssl_is_present)
+ {
if (!sslStream)
return -1;
int r = SSL_read(sslStream, &ch, 1);
ERR_error_string(ERR_get_error(), NULL));
return -1;
}
+ }
#endif
}
else