stub out cryptopp for Xbox

This commit is contained in:
Chris Danford
2005-04-27 01:17:47 +00:00
parent bbd4e2a251
commit e836c16466
2 changed files with 27 additions and 5 deletions
+24 -5
View File
@@ -4,24 +4,42 @@
#include "RageLog.h" #include "RageLog.h"
#include "PrefsManager.h" #include "PrefsManager.h"
#include "RageFileManager.h" #include "RageFileManager.h"
#include "crypto/CryptMD5.h"
CryptManager* CRYPTMAN = NULL; // global and accessable from anywhere in our program
static const CString PRIVATE_KEY_PATH = "Data/private.rsa";
static const CString PUBLIC_KEY_PATH = "Data/public.rsa";
#if !defined(HAVE_CRYPTOPP)
CryptManager::CryptManager() { }
CryptManager::~CryptManager() { }
void CryptManager::GenerateRSAKey( unsigned int keyLength, CString privFilename, CString pubFilename, CString seed ) { }
void CryptManager::SignFileToFile( CString sPath, CString sSignatureFile ) { }
bool CryptManager::VerifyFileWithFile( CString sPath, CString sSignatureFile )
{
return true;
}
bool CryptManager::Verify( CString sPath, CString sSignature )
{
return true;
}
#else
// crypt headers // crypt headers
#include "CryptHelpers.h" #include "CryptHelpers.h"
#include "crypto51/sha.h" #include "crypto51/sha.h"
#include "crypto51/rsa.h" #include "crypto51/rsa.h"
#include "crypto51/osrng.h" #include "crypto51/osrng.h"
#include "crypto/CryptMD5.h"
#include <memory> #include <memory>
using namespace CryptoPP; using namespace CryptoPP;
static const CString PRIVATE_KEY_PATH = "Data/private.rsa";
static const CString PUBLIC_KEY_PATH = "Data/public.rsa";
static const int KEY_LENGTH = 1024; static const int KEY_LENGTH = 1024;
#define MAX_SIGNATURE_SIZE_BYTES 1024 // 1 KB #define MAX_SIGNATURE_SIZE_BYTES 1024 // 1 KB
CryptManager* CRYPTMAN = NULL; // global and accessable from anywhere in our program
CryptManager::CryptManager() CryptManager::CryptManager()
{ {
// //
@@ -167,6 +185,7 @@ bool CryptManager::Verify( CString sPath, CString sSignature )
return false; return false;
} }
} }
#endif
static CString BinaryToHex( const unsigned char *string, int iNumBytes ) static CString BinaryToHex( const unsigned char *string, int iNumBytes )
{ {
+3
View File
@@ -11,10 +11,12 @@
#define HAVE_COCOA #define HAVE_COCOA
#define HAVE_COREAUDIO #define HAVE_COREAUDIO
#define HAVE_SDL #define HAVE_SDL
#define HAVE_CRYPTOPP
#endif #endif
#if defined(_WINDOWS) #if defined(_WINDOWS)
#define HAVE_DIRECTX #define HAVE_DIRECTX
#define HAVE_WIN32 // XXX: Better name for this API? #define HAVE_WIN32 // XXX: Better name for this API?
#define HAVE_CRYPTOPP
#endif #endif
#if defined(_XBOX) #if defined(_XBOX)
#define HAVE_DIRECTX #define HAVE_DIRECTX
@@ -23,6 +25,7 @@
#if defined(LINUX) #if defined(LINUX)
#define HAVE_UNIX // Here just to be explicit. #define HAVE_UNIX // Here just to be explicit.
#define HAVE_LINUXKERNEL #define HAVE_LINUXKERNEL
#define HAVE_CRYPTOPP
#endif #endif
#endif #endif