From e28993aab59cd00079ea08876330b259aba1c013 Mon Sep 17 00:00:00 2001 From: Adam Johnson Date: Mon, 9 Jan 2012 01:24:20 -0500 Subject: [PATCH] Tighten up plStreamSource::GetFile for internal clients --- Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp index 4f58db81..e6a21c5a 100644 --- a/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp +++ b/Sources/Plasma/PubUtilLib/plFile/plStreamSource.cpp @@ -128,7 +128,12 @@ hsStream* plStreamSource::GetFile(std::wstring filename) if (plSecureStream::IsSecureFile(sFilename.c_str())) { UInt32 encryptionKey[4]; - plFileUtils::GetSecureEncryptionKey(sFilename.c_str(), encryptionKey, 4); + if (!plFileUtils::GetSecureEncryptionKey(sFilename.c_str(), encryptionKey, 4)) + { + FATAL("Hey camper... You need an NTD key file!"); + return nil; + } + fFileData[filename].fStream = plSecureStream::OpenSecureFile(sFilename.c_str(), 0, encryptionKey); } else // otherwise it is an encrypted or plain stream, this call handles both