From ba72d9e3411f1b3dc25d0dbab3f06790fea59309 Mon Sep 17 00:00:00 2001 From: Chris Danford Date: Sat, 14 Feb 2004 11:13:23 +0000 Subject: [PATCH] compile cryptlib files in the main project - not in a separate lib --- stepmania/src/CryptHelpers.cpp | 29 ++- stepmania/src/Makefile.am | 5 +- stepmania/src/StepMania.dsp | 398 ++++++++++++++++++++++++++++++++- stepmania/src/StepMania.dsw | 15 -- stepmania/src/StepMania.sln | 11 - stepmania/src/StepMania.vcproj | 84 ++++++- 6 files changed, 500 insertions(+), 42 deletions(-) diff --git a/stepmania/src/CryptHelpers.cpp b/stepmania/src/CryptHelpers.cpp index 86d17222e6..f0050c2da5 100644 --- a/stepmania/src/CryptHelpers.cpp +++ b/stepmania/src/CryptHelpers.cpp @@ -4,23 +4,28 @@ #include "channels.h" #include "rsa.h" #include "md5.h" +#include "randpool.h" #include -/* Pull in crypt library here. */ -#ifdef _XBOX - // FIXME -#elif defined _WINDOWS - #ifdef DEBUG - #pragma comment(lib, "crypto51/cryptlibd.lib") - #else - #pragma comment(lib, "crypto51/cryptlib.lib") - #endif -#endif - - using namespace CryptoPP; using namespace std; +void GenerateRSAKey(unsigned int keyLength, const char *privFilename, const char *pubFilename, const char *seed) +{ + RandomPool randPool; + randPool.Put((byte *)seed, strlen(seed)); + + RSAES_OAEP_SHA_Decryptor priv(randPool, keyLength); + HexEncoder privFile(new FileSink(privFilename)); + priv.DEREncode(privFile); + privFile.MessageEnd(); + + RSAES_OAEP_SHA_Encryptor pub(priv); + HexEncoder pubFile(new FileSink(pubFilename)); + pub.DEREncode(pubFile); + pubFile.MessageEnd(); +} + void RSASignFile(const char *privFilename, const char *messageFilename, const char *signatureFilename) { FileSource privFile(privFilename, true, new HexDecoder); diff --git a/stepmania/src/Makefile.am b/stepmania/src/Makefile.am index faa4648d1c..d09a3125a8 100644 --- a/stepmania/src/Makefile.am +++ b/stepmania/src/Makefile.am @@ -209,9 +209,12 @@ LightsManager.cpp LightsManager.h MemoryCardManager.cpp MemoryCardManager.h Note ProfileManager.cpp ProfileManager.h ScreenManager.cpp ScreenManager.h SongManager.cpp SongManager.h ThemeManager.cpp ThemeManager.h \ UnlockSystem.cpp UnlockSystem.h +cryptlib = \ +crypto51\algparam.cpp crypto51\asn.cpp crypto51\basecode.cpp crypto51\channels.cpp crypto51\cryptlib.cpp crypto51\des.cpp crypto51\dessp.cpp crypto51\files.cpp crypto51\filters.cpp crypto51\fips140.cpp crypto51\hex.cpp crypto51\integer.cpp crypto51\iterhash.cpp crypto51\md5.cpp crypto51\misc.cpp crypto51\modes.cpp crypto51\mqueue.cpp crypto51\nbtheory.cpp crypto51\pkcspad.cpp crypto51\pssr.cpp crypto51\pubkey.cpp crypto51\queue.cpp crypto51\randpool.cpp crypto51\rsa.cpp crypto51\sha.cpp crypto51\strciphr.cpp + stepmania_SOURCES = $(Screens) $(DataStructures) $(FileTypes) $(StepMania) $(Arch) \ $(ActorsInGameplayAndMenus) $(ActorsInMenus) $(ActorsInGameplay) \ - $(Rage) $(Actors) $(GlobalSingletons) + $(Rage) $(Actors) $(GlobalSingletons) $(cryptlib) stepmania_LDADD = \ $(GL_LIBS) \ diff --git a/stepmania/src/StepMania.dsp b/stepmania/src/StepMania.dsp index 0c315b212e..d6ab1a4506 100644 --- a/stepmania/src/StepMania.dsp +++ b/stepmania/src/StepMania.dsp @@ -65,7 +65,7 @@ IntDir=.\../Debug6 TargetDir=\stepmania\itg\Program TargetName=StepMania-debug SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -142,7 +142,7 @@ IntDir=.\../Release6 TargetDir=\stepmania\stepmania\Program TargetName=StepMania SOURCE="$(InputPath)" -PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ +PreLink_Cmds=disasm\verinc cl /Zl /nologo /c verstub.cpp /Fo$(IntDir)\ PostBuild_Cmds=disasm\mapconv $(IntDir)\$(TargetName).map $(TargetDir)\StepMania.vdi # End Special Build Tool @@ -6097,6 +6097,400 @@ SOURCE=.\UnlockSystem.cpp # Begin Source File SOURCE=.\UnlockSystem.h +# End Source File +# End Group +# Begin Group "cryptlib" + +# PROP Default_Filter "" +# Begin Source File + +SOURCE=.\crypto51\algparam.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\asn.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\basecode.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\channels.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\cryptlib.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\des.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\dessp.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\files.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\filters.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\fips140.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\hex.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\integer.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\iterhash.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\md5.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\misc.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\modes.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\mqueue.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\nbtheory.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\pkcspad.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\pssr.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\pubkey.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\queue.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\randpool.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\rsa.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\sha.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + +# End Source File +# Begin Source File + +SOURCE=.\crypto51\strciphr.cpp + +!IF "$(CFG)" == "StepMania - Win32 Debug" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Debug" + +!ELSEIF "$(CFG)" == "StepMania - Win32 Release" + +!ELSEIF "$(CFG)" == "StepMania - Xbox Release" + +!ENDIF + # End Source File # End Group # Begin Source File diff --git a/stepmania/src/StepMania.dsw b/stepmania/src/StepMania.dsw index 548724dc6d..72a285dc22 100644 --- a/stepmania/src/StepMania.dsw +++ b/stepmania/src/StepMania.dsw @@ -9,21 +9,6 @@ Package=<5> {{{ }}} -Package=<4> -{{{ - Begin Project Dependency - Project_Dep_Name cryptlib - End Project Dependency -}}} - -############################################################################### - -Project: "cryptlib"=.\crypto51\cryptlib.dsp - Package Owner=<4> - -Package=<5> -{{{ -}}} - Package=<4> {{{ }}} diff --git a/stepmania/src/StepMania.sln b/stepmania/src/StepMania.sln index b7fb5f6b66..5c7b62d131 100644 --- a/stepmania/src/StepMania.sln +++ b/stepmania/src/StepMania.sln @@ -1,8 +1,6 @@ Microsoft Visual Studio Solution File, Format Version 7.00 Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "StepMania", "StepMania.vcproj", "{670745A6-106B-420D-A2A9-D4F89A23986E}" EndProject -Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "cryptlib", "crypto51\cryptlib.vcproj", "{E34673D6-55FA-45C9-933A-FDD68CCD785F}" -EndProject Global GlobalSection(SolutionConfiguration) = preSolution ConfigName.0 = Debug @@ -11,7 +9,6 @@ Global ConfigName.3 = Release EndGlobalSection GlobalSection(ProjectDependencies) = postSolution - {670745A6-106B-420D-A2A9-D4F89A23986E}.0 = {E34673D6-55FA-45C9-933A-FDD68CCD785F} EndGlobalSection GlobalSection(ProjectConfiguration) = postSolution {670745A6-106B-420D-A2A9-D4F89A23986E}.Debug.ActiveCfg = Debug|Win32 @@ -22,14 +19,6 @@ Global {670745A6-106B-420D-A2A9-D4F89A23986E}.FIPS 140 Release.Build.0 = Release|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.ActiveCfg = Release|Win32 {670745A6-106B-420D-A2A9-D4F89A23986E}.Release.Build.0 = Release|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.Debug.ActiveCfg = Debug|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.Debug.Build.0 = Debug|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Debug.ActiveCfg = FIPS 140 Debug|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Debug.Build.0 = FIPS 140 Debug|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Release.ActiveCfg = FIPS 140 Release|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.FIPS 140 Release.Build.0 = FIPS 140 Release|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.Release.ActiveCfg = Release|Win32 - {E34673D6-55FA-45C9-933A-FDD68CCD785F}.Release.Build.0 = Release|Win32 EndGlobalSection GlobalSection(ExtensibilityGlobals) = postSolution DPBuild = 5 diff --git a/stepmania/src/StepMania.vcproj b/stepmania/src/StepMania.vcproj index 215e3cf560..126e50332b 100644 --- a/stepmania/src/StepMania.vcproj +++ b/stepmania/src/StepMania.vcproj @@ -24,7 +24,7 @@ Name="VCCLCompilerTool" AdditionalOptions="/EHa" Optimization="0" - AdditionalIncludeDirectories=".,SDL-1.2.6/include,SDL_image-1.2,vorbis,libjpeg" + AdditionalIncludeDirectories=".,SDL-1.2.6/include,SDL_image-1.2,vorbis,libjpeg,crypto51" PreprocessorDefinitions="WIN32,_DEBUG,_WINDOWS,DEBUG" ExceptionHandling="FALSE" BasicRuntimeChecks="3" @@ -2069,6 +2069,88 @@ cl /Zl /nologo /c verstub.cpp /Fo"$(IntDir)"\ RelativePath="UnlockSystem.h"> + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +