diff --git a/pokerth_game.pro b/pokerth_game.pro index 27c96b9e..789b52c6 100644 --- a/pokerth_game.pro +++ b/pokerth_game.pro @@ -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 diff --git a/pokerth_lib.pro b/pokerth_lib.pro index cfd7b3c4..21c1a23e 100644 --- a/pokerth_lib.pro +++ b/pokerth_lib.pro @@ -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 diff --git a/pokerth_server.pro b/pokerth_server.pro index 355989b9..4534b06d 100644 --- a/pokerth_server.pro +++ b/pokerth_server.pro @@ -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 diff --git a/src/core/common/avatarmanager.cpp b/src/core/common/avatarmanager.cpp index 2511d932..af4ce593 100644 --- a/src/core/common/avatarmanager.cpp +++ b/src/core/common/avatarmanager.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include diff --git a/src/core/common/crypthelper.cpp b/src/core/common/crypthelper.cpp index 622766d6..edb2b8f6 100644 --- a/src/core/common/crypthelper.cpp +++ b/src/core/common/crypthelper.cpp @@ -20,7 +20,7 @@ #include "crypthelper.h" -#include +#include #include #include diff --git a/src/core/openssl_wrapper.h b/src/core/openssl_wrapper.h new file mode 100644 index 00000000..cff65624 --- /dev/null +++ b/src/core/openssl_wrapper.h @@ -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 +#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 + +#endif diff --git a/src/engine/local_engine/tools.cpp b/src/engine/local_engine/tools.cpp index 08b8b369..df6471c4 100755 --- a/src/engine/local_engine/tools.cpp +++ b/src/engine/local_engine/tools.cpp @@ -21,7 +21,7 @@ #include "tools.h" #include -#include +#include #include @@ -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; diff --git a/src/net/common/serverlobbythread.cpp b/src/net/common/serverlobbythread.cpp index 2bc3d79b..38bfe5cb 100644 --- a/src/net/common/serverlobbythread.cpp +++ b/src/net/common/serverlobbythread.cpp @@ -26,7 +26,7 @@ #include #include #include -#include +#include #include #include