diff --git a/MTA10_Server/mods/deathmatch/Makefile.am b/MTA10_Server/mods/deathmatch/Makefile.am index 662ad17a47..66462a1874 100644 --- a/MTA10_Server/mods/deathmatch/Makefile.am +++ b/MTA10_Server/mods/deathmatch/Makefile.am @@ -1,11 +1,13 @@ ZIPDIR=$(srcdir)/../../../vendor/zip/ LUADIR=$(srcdir)/../../../vendor/lua LUABDIR=$(builddir)/../../../vendor/lua +CRYPTOPP=$(srcdir)/../../../vendor/cryptopp/ INCLUDES += -I$(srcdir)/logic/ INCLUDES += -I$(srcdir)/../../sdk/ INCLUDES += -I$(srcdir)/../../../Shared/sdk/ INCLUDES += -I$(srcdir)/../../../Shared/publicsdk/include/ +INCLUDES += -I$(srcdir)/../../../vendor/ INCLUDES += -I$(srcdir)/../../../vendor/ehs/ INCLUDES += -I$(srcdir)/../../../vendor/pme/ INCLUDES += -I$(srcdir)/../../../vendor/json-c/ @@ -358,4 +360,5 @@ deathmatch_la_LIBADD = \ $(SPARSEHASH_LIBS) deathmatch_la_LDFLAGS = \ - -module -avoid-version -lz + -module -avoid-version -lz \ + -L$(CRYPTOPP) -lcryptopp diff --git a/MTA10_Server/mods/deathmatch/logic/CHTTPD.cpp b/MTA10_Server/mods/deathmatch/logic/CHTTPD.cpp index 9d1b6cfb2d..f46c311c42 100644 --- a/MTA10_Server/mods/deathmatch/logic/CHTTPD.cpp +++ b/MTA10_Server/mods/deathmatch/logic/CHTTPD.cpp @@ -133,7 +133,9 @@ ResponseCode CHTTPD::HandleRequest ( HttpRequest * ipoHttpRequest, { // Load public RSA key from disk RSA::PublicKey publicKey; - StringSource stringSource ( Base64::decode ( encodedPublicKey, SString () ), true ); + std::string base64Data; + Base64::decode ( encodedPublicKey, base64Data ); + StringSource stringSource ( base64Data, true ); publicKey.Load ( stringSource ); // Launch encryptor and encrypt diff --git a/initial-install.sh b/initial-install.sh index a09a55b6fc..c442d5dfb3 100755 --- a/initial-install.sh +++ b/initial-install.sh @@ -13,7 +13,7 @@ autoreconf -fiv # then look at the configure options: # ./configure --help -if [ $1 = "-g" ]; then +if [ "$1" = "-g" ]; then ./configure --with-pic --disable-system-pcre --enable-utf8 \ CFLAGS='-g -O2 -fPIC -DPIC' \ CXXFLAGS='-g -O2 -fPIC -DPIC -std=c++0x' \ @@ -39,9 +39,18 @@ cd ./vendor/google-breakpad make CXXFLAGS='-Wno-sign-compare' cd ../.. +# Build Crypto++ +cd ./vendor/cryptopp +if [ "$1" = "-g" ]; then + make static WITH_SYMBOLS=1 +else + make static +fi +cd ../.. + # then you have makefiles and the source can be compiled :) # building in parallel mode (use -j) -if [ $1 = "-g" ]; then +if [ "$1" = "-g" ]; then make \ CFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing' \ CXXFLAGS='-g -O2 -fPIC -DPIC -Wno-uninitialized -Wno-narrowing -std=c++0x' \ diff --git a/vendor/cryptopp/GNUmakefile b/vendor/cryptopp/GNUmakefile index b1ab53709a..087690d030 100644 --- a/vendor/cryptopp/GNUmakefile +++ b/vendor/cryptopp/GNUmakefile @@ -1,7 +1,10 @@ -CXXFLAGS = -DNDEBUG -g -O2 +ifeq ($(WITH_SYMBOLS), 1) + CXXFLAGS = -DNDEBUG -g -O2 +endif + # -O3 fails to link on Cygwin GCC version 4.5.3 # -fPIC is supported. Please report any breakage of -fPIC as a bug. -# CXXFLAGS += -fPIC +CXXFLAGS += -fPIC # the following options reduce code size, but breaks link or makes link very slow on some systems # CXXFLAGS += -ffunction-sections -fdata-sections # LDFLAGS += -Wl,--gc-sections