From dacdf4e60ffe71b0ca34f97bb71098f546d36717 Mon Sep 17 00:00:00 2001 From: AlexDereka Date: Mon, 1 Jun 2009 11:42:56 +0400 Subject: [PATCH] [7937] Check OpenSSL lib at server start up. --- src/mangosd/Main.cpp | 10 ++++++++++ src/realmd/Main.cpp | 10 ++++++++++ src/shared/revision_nr.h | 2 +- 3 files changed, 21 insertions(+), 1 deletion(-) diff --git a/src/mangosd/Main.cpp b/src/mangosd/Main.cpp index 043e1c0b4..a6a1f0440 100644 --- a/src/mangosd/Main.cpp +++ b/src/mangosd/Main.cpp @@ -28,6 +28,8 @@ #include "SystemConfig.h" #include "revision.h" #include "revision_nr.h" +#include +#include #ifdef WIN32 #include "ServiceWin32.h" @@ -158,6 +160,14 @@ extern int main(int argc, char **argv) sLog.outString("Using configuration file %s.", cfg_file); + sLog.outString("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + if (SSLeay() < 0x009080bfL) + { + sLog.outError("Outdated version of OpenSSL lib, Logins to server impossible!"); + sLog.outError("minimal required version [OpenSSL 0.9.8k]"); + return 1; + } + ///- and run the 'Master' /// \todo Why do we need this 'Master'? Can't all of this be in the Main as for Realmd? return sMaster.Run(); diff --git a/src/realmd/Main.cpp b/src/realmd/Main.cpp index 08611268e..8c150eb1f 100644 --- a/src/realmd/Main.cpp +++ b/src/realmd/Main.cpp @@ -32,6 +32,8 @@ #include "revision.h" #include "revision_nr.h" #include "Util.h" +#include +#include #ifdef WIN32 #include "ServiceWin32.h" @@ -161,6 +163,14 @@ extern int main(int argc, char **argv) while (pause > clock()) {} } + sLog.outString("%s (Library: %s)", OPENSSL_VERSION_TEXT, SSLeay_version(SSLEAY_VERSION)); + if (SSLeay() < 0x009080bfL ) + { + sLog.outError("Outdated version of OpenSSL lib, Logins to server impossible!"); + sLog.outError("minimal required version [OpenSSL 0.9.8k]"); + return 1; + } + /// realmd PID file creation std::string pidfile = sConfig.GetStringDefault("PidFile", ""); if(!pidfile.empty()) diff --git a/src/shared/revision_nr.h b/src/shared/revision_nr.h index e07c9fa24..5b806bbaa 100644 --- a/src/shared/revision_nr.h +++ b/src/shared/revision_nr.h @@ -1,4 +1,4 @@ #ifndef __REVISION_NR_H__ #define __REVISION_NR_H__ - #define REVISION_NR "7936" + #define REVISION_NR "7937" #endif // __REVISION_NR_H__