Detect pak encryption being enabled when no keys have been generated. Issue a warning and disable encryption.

#jira UE-77230
#rb none

#ROBOMERGE-SOURCE: CL 7785639 in //UE4/Release-4.23/...
#ROBOMERGE-BOT: RELEASE (Release-4.23 -> Main) (v388-7785529)

[CL 7785685 by graeme thornton in Main branch]
This commit is contained in:
graeme thornton
2019-08-06 06:50:25 -04:00
parent d9d8b06f34
commit d36f05799a
@@ -449,7 +449,9 @@ namespace UnrealBuildTool
Settings.bEnablePakSigning = false;
}
if (Settings.bDataCryptoRequired && Settings.IsAnyEncryptionEnabled() && (Settings.EncryptionKey == null || !Settings.EncryptionKey.IsValid()))
bool bEncryptionKeyValid = (Settings.EncryptionKey != null && Settings.EncryptionKey.IsValid());
bool bAnyEncryptionRequested = Settings.bEnablePakFullAssetEncryption || Settings.bEnablePakIndexEncryption || Settings.bEnablePakIniEncryption || Settings.bEnablePakUAssetEncryption;
if (Settings.bDataCryptoRequired && bAnyEncryptionRequested && !bEncryptionKeyValid)
{
Log.TraceWarningOnce("Pak encryption is enabled, but no valid encryption key was found. Please generate a key in the editor project crypto settings. Encryption will be disabled");
Settings.bEnablePakUAssetEncryption = false;