mirror of
https://foundry.openuru.org/gitblit/r/CWE-ou-minkata.git
synced 2025-07-17 10:52:46 +00:00
Remove log and init file encryption.
This fixes issue #123, and is supposed to get rid of encryption for the status logs and the init files loaded at startup.
This commit is contained in:
@ -543,29 +543,24 @@ bool plEncryptedStream::IsEncryptedFile(const wchar_t* fileName)
|
||||
return isEncrypted;
|
||||
}
|
||||
|
||||
hsStream* plEncryptedStream::OpenEncryptedFile(const char* fileName, bool requireEncrypted, uint32_t* cryptKey)
|
||||
hsStream* plEncryptedStream::OpenEncryptedFile(const char* fileName, uint32_t* cryptKey)
|
||||
{
|
||||
wchar_t* wFilename = hsStringToWString(fileName);
|
||||
hsStream* ret = OpenEncryptedFile(wFilename, requireEncrypted, cryptKey);
|
||||
hsStream* ret = OpenEncryptedFile(wFilename, cryptKey);
|
||||
delete [] wFilename;
|
||||
return ret;
|
||||
}
|
||||
|
||||
hsStream* plEncryptedStream::OpenEncryptedFile(const wchar_t* fileName, bool requireEncrypted, uint32_t* cryptKey)
|
||||
hsStream* plEncryptedStream::OpenEncryptedFile(const wchar_t* fileName, uint32_t* cryptKey)
|
||||
{
|
||||
#ifndef PLASMA_EXTERNAL_RELEASE
|
||||
requireEncrypted = false;
|
||||
#endif
|
||||
|
||||
bool isEncrypted = IsEncryptedFile(fileName);
|
||||
|
||||
hsStream* s = nil;
|
||||
if (isEncrypted)
|
||||
s = new plEncryptedStream(cryptKey);
|
||||
// If this isn't an external release, let them use unencrypted data
|
||||
else
|
||||
if (!requireEncrypted)
|
||||
s = new hsUNIXStream;
|
||||
s = new hsUNIXStream;
|
||||
|
||||
if (s)
|
||||
s->Open(fileName, L"rb");
|
||||
|
@ -107,8 +107,8 @@ public:
|
||||
// Attempts to create a read-binary stream for the requested file. If it's
|
||||
// encrypted, you'll get a plEncryptedStream, otherwise just a standard
|
||||
// hsUNIXStream. Remember to delete the stream when you're done with it.
|
||||
static hsStream* OpenEncryptedFile(const char* fileName, bool requireEncrypted = true, uint32_t* cryptKey = nil);
|
||||
static hsStream* OpenEncryptedFile(const wchar_t* fileName, bool requireEncrypted = true, uint32_t* cryptKey = nil);
|
||||
static hsStream* OpenEncryptedFile(const char* fileName, uint32_t* cryptKey = nil);
|
||||
static hsStream* OpenEncryptedFile(const wchar_t* fileName, uint32_t* cryptKey = nil);
|
||||
static hsStream* OpenEncryptedFileWrite(const char* fileName, uint32_t* cryptKey = nil);
|
||||
static hsStream* OpenEncryptedFileWrite(const wchar_t* fileName, uint32_t* cryptKey = nil);
|
||||
};
|
||||
|
@ -83,7 +83,6 @@ void plInitFileReader::IInitReaders( plInitSectionReader **readerArray )
|
||||
|
||||
plInitFileReader::plInitFileReader( plInitSectionReader **readerArray, uint16_t lineSize )
|
||||
{
|
||||
fRequireEncrypted = true;
|
||||
fCurrLine = nil;
|
||||
fLineSize = lineSize;
|
||||
fStream = fOurStream = nil;
|
||||
@ -93,7 +92,6 @@ plInitFileReader::plInitFileReader( plInitSectionReader **readerArray, uint16_t
|
||||
|
||||
plInitFileReader::plInitFileReader( const char *fileName, plInitSectionReader **readerArray, uint16_t lineSize )
|
||||
{
|
||||
fRequireEncrypted = true;
|
||||
fCurrLine = nil;
|
||||
fLineSize = lineSize;
|
||||
fStream = fOurStream = nil;
|
||||
@ -105,7 +103,6 @@ plInitFileReader::plInitFileReader( const char *fileName, plInitSectionReader **
|
||||
|
||||
plInitFileReader::plInitFileReader( hsStream *stream, plInitSectionReader **readerArray, uint16_t lineSize )
|
||||
{
|
||||
fRequireEncrypted = true;
|
||||
fCurrLine = nil;
|
||||
fLineSize = lineSize;
|
||||
fStream = fOurStream = nil;
|
||||
@ -129,7 +126,7 @@ bool plInitFileReader::Open( const char *fileName )
|
||||
return false;
|
||||
}
|
||||
|
||||
fOurStream = plEncryptedStream::OpenEncryptedFile( fileName, fRequireEncrypted );
|
||||
fOurStream = plEncryptedStream::OpenEncryptedFile( fileName );
|
||||
|
||||
if( fOurStream == nil )
|
||||
return false;
|
||||
|
@ -118,7 +118,6 @@ class plInitFileReader
|
||||
hsStream *fOurStream;
|
||||
char *fCurrLine;
|
||||
uint32_t fLineSize;
|
||||
bool fRequireEncrypted;
|
||||
|
||||
plInitSectionReader *fCurrSection;
|
||||
hsTArray<plInitSectionReader *> fSections;
|
||||
@ -138,8 +137,6 @@ class plInitFileReader
|
||||
plInitFileReader( hsStream *stream, plInitSectionReader **readerArray, uint16_t lineSize = 256 );
|
||||
virtual ~plInitFileReader();
|
||||
|
||||
void SetRequireEncrypted(bool require) { fRequireEncrypted = require; }
|
||||
bool GetRequireEncrypted() const { return fRequireEncrypted; }
|
||||
void SetUnhandledSectionReader(plInitSectionReader* reader) { fUnhandledSection = reader; }
|
||||
|
||||
bool Open( const char *fileName );
|
||||
|
Reference in New Issue
Block a user