Use GnuTLS-OpenSSL instead of OpenSSL. Thanks to Zhenech for help with this patch.

This commit is contained in:
lotodore
2008-04-21 22:27:15 +00:00
parent 505ee2c984
commit d7c6cdd75c
8 changed files with 56 additions and 24 deletions
+5 -7
View File
@@ -261,8 +261,8 @@ win32{
DEFINES += CURL_STATICLIB
DEPENDPATH += src/net/win32/ src/core/win32
INCLUDEPATH += ../boost/ ../SDL/include ../SDL_mixer
INCLUDEPATH += ../SDL/include/SDL ../SDL_mixer/include ../OpenSSL/include ../curl/include ../zlib
LIBPATH += ../boost/stage/lib ../OpenSSL/lib ../curl/lib ../zlib
INCLUDEPATH += ../SDL/include/SDL ../SDL_mixer/include ../GnuTLS/include ../curl/include ../zlib
LIBPATH += ../boost/stage/lib ../GnuTLS/lib ../curl/lib ../zlib
LIBS += -lpokerth_lib
@@ -271,8 +271,7 @@ win32{
LIBPATH += Release/lib ../SDL/VisualC/SDL/Release ../SDL/VisualC/SDLmain/Release ../SDL_mixer/VisualC/Release
#LIBPATH += Debug/lib ../SDL/VisualC/SDL/Debug ../SDL/VisualC/SDLmain/Debug ../SDL_mixer/VisualC/Debug
LIBS += -llibeay32
LIBS += -lssleay32
LIBS += -lgnutls-openssl
LIBS += -llibcurl
}
@@ -280,8 +279,7 @@ win32{
LIBPATH += Release/lib
#LIBPATH += Debug/lib
LIBPATH += ../SDL/lib ../SDL_mixer/lib
LIBS += -lcrypto
LIBS += -lssl
LIBS += -lgnutls-openssl
LIBS += -lcurl
LIBS += -lz
LIBS += -llibboost_thread-mgw34-mt-1_35
@@ -346,7 +344,7 @@ unix: !mac{
LIBS += -lpokerth_lib
LIBS += $$BOOST_LIBS
LIBS += -lcrypto -lSDL_mixer -lcurl -lz
LIBS += -lgnutls-openssl -lSDL_mixer -lcurl -lz
TARGETDEPS += ./lib/libpokerth_lib.a
## My release static libs
+1 -1
View File
@@ -181,7 +181,7 @@ win32{
DEPENDPATH += src/net/win32/ src/core/win32
SOURCES += src/net/win32/socket_helper.cpp \
src/net/win32/socket_startup.cpp
INCLUDEPATH += ../boost/ ../OpenSSL/include ../curl/include
INCLUDEPATH += ../boost/ ../GnuTLS/include ../curl/include
}
!win32{
DEPENDPATH += src/net/linux/ src/core/linux
+6 -8
View File
@@ -114,11 +114,11 @@ SOURCES += \
win32 {
DEFINES += CURL_STATICLIB
DEPENDPATH += src/net/win32/ src/core/win32
INCLUDEPATH += ../boost/ ../OpenSSL/include
INCLUDEPATH += ../boost/ ../GnuTLS/include
SOURCES += src/core/win32/convhelper.cpp
LIBPATH += ../boost/stage/lib ../OpenSSL/lib
LIBPATH += ../boost/stage/lib ../GnuTLS/lib
LIBPATH += Release/lib
#LIBPATH += Debug/lib
@@ -126,13 +126,11 @@ win32 {
LIBS += -lpokerth_lib
win32-msvc2005{
LIBS += -llibeay32
LIBS += -lssleay32
LIBS += -llibgnutls-openssl
}
win32-g++{
LIBS += -lcrypto
LIBS += -lssl
LIBS += -lgnutls-openssl
LIBS += -llibboost_thread-mgw34-mt-1_35
LIBS += -llibboost_filesystem-mgw34-mt-1_35
LIBS += -llibboost_system-mgw34-mt-1_35
@@ -198,7 +196,7 @@ unix : !mac {
LIBS += -lpokerth_lib
LIBS += $$BOOST_LIBS
LIBS += -lcrypto -lcurl
LIBS += -lgnutls-openssl -lcurl
TARGETDEPS += ./lib/libpokerth_lib.a
@@ -228,7 +226,7 @@ mac{
LIBS += /usr/local/lib/libboost_filesystem-mt-1_34_1.a
LIBS += /usr/local/lib/libboost_program_options-mt-1_34_1.a
# libraries installed on every mac
LIBS += -lcrypto -liconv
LIBS += -lgnutls-openssl -liconv
# set the application icon
RC_FILE = pokerth.icns
LIBPATH += /Developer/SDKs/MacOSX10.4u.sdk/usr/lib
+1 -1
View File
@@ -26,7 +26,7 @@
#include <boost/filesystem.hpp>
#include <boost/lambda/lambda.hpp>
#include <boost/algorithm/string/predicate.hpp>
#include <openssl/md5.h>
#include <core/openssl_wrapper.h>
#include <fstream>
#include <cstring>
+1 -1
View File
@@ -20,7 +20,7 @@
#include "crypthelper.h"
#include <openssl/md5.h>
#include <core/openssl_wrapper.h>
#include <cstring>
#include <cstdio>
+38
View File
@@ -0,0 +1,38 @@
/***************************************************************************
* Copyright (C) 2008 by Lothar May *
* *
* This program is free software; you can redistribute it and/or modify *
* it under the terms of the GNU General Public License as published by *
* the Free Software Foundation; either version 2 of the License, or *
* (at your option) any later version. *
* *
* This program is distributed in the hope that it will be useful, *
* but WITHOUT ANY WARRANTY; without even the implied warranty of *
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the *
* GNU General Public License for more details. *
* *
* You should have received a copy of the GNU General Public License *
* along with this program; if not, write to the *
* Free Software Foundation, Inc., *
* 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. *
***************************************************************************/
/* Wrapper for GnuTLS openssl include. Needed for Windows compatibility. */
#ifndef _OPENSSL_WRAPPER_H_
#define _OPENSSL_WRAPPER_H_
#ifndef HAVE_SSIZE_T
# define HAVE_SSIZE_T
#include <sys/types.h>
#if (defined _WIN32) && (!defined ssize_t)
typedef int ssize_t; // This is only for Windows. Supports only Win32.
#endif
#endif
#ifdef X509_NAME
#undef X509_NAME // Again for Windows - conflict with WinCrypt.h.
#endif
#include <gnutls/openssl.h>
#endif
+3 -5
View File
@@ -21,7 +21,7 @@
#include "tools.h"
#include <core/loghelper.h>
#include <openssl/rand.h>
#include <core/openssl_wrapper.h>
#include <limits>
@@ -41,8 +41,7 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
if(!RAND_bytes(rand_buf, 4))
{
RAND_pseudo_bytes(rand_buf, 4);
LOG_MSG("RAND_bytes failed, using RAND_pseudo_bytes.");
LOG_MSG("RAND_bytes failed!");
}
randNumber = 0;
@@ -66,8 +65,7 @@ void Tools::getRandNumber(int start, int end, int howMany, int* randArray, bool
if(!RAND_bytes(rand_buf, 4))
{
RAND_pseudo_bytes(rand_buf, 4);
LOG_MSG("RAND_bytes failed, using RAND_pseudo_bytes.");
LOG_MSG("RAND_bytes failed!");
}
randNumber = 0;
+1 -1
View File
@@ -26,7 +26,7 @@
#include <net/socket_msg.h>
#include <core/avatarmanager.h>
#include <core/loghelper.h>
#include <openssl/rand.h>
#include <core/openssl_wrapper.h>
#include <fstream>
#include <algorithm>