aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
diff options
context:
space:
mode:
authormageven <62494521+mageven@users.noreply.github.com>2021-01-26 23:15:07 +0530
committerGitHub <noreply@github.com>2021-01-26 18:45:07 +0100
commitd1e24ba5c247bb9cfdeca7251bf5f8951c927576 (patch)
tree6786f53b05029af4137e9a6558238844855445fd /Ryujinx.HLE/FileSystem/Content/ContentManager.cs
parent9551bfdeebee663f119b4fbaa7196ce8d810f41a (diff)
Initial Setup: Reload keys before verifying firmware (#1955)
* Initial Setup: Reload keys before verifying firmware Also, display the NoKeys dialog if keyset is empty when verifying firmware. * LoadApplications: Remove the lone debug log and print the error directly
Diffstat (limited to 'Ryujinx.HLE/FileSystem/Content/ContentManager.cs')
-rw-r--r--Ryujinx.HLE/FileSystem/Content/ContentManager.cs9
1 files changed, 9 insertions, 0 deletions
diff --git a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
index 4c4f3c86..1630835d 100644
--- a/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
+++ b/Ryujinx.HLE/FileSystem/Content/ContentManager.cs
@@ -653,6 +653,15 @@ namespace Ryujinx.HLE.FileSystem.Content
public SystemVersion VerifyFirmwarePackage(string firmwarePackage)
{
+ _virtualFileSystem.Reload();
+
+ // LibHac.NcaHeader's DecryptHeader doesn't check if HeaderKey is empty and throws InvalidDataException instead
+ // So, we check it early for a better user experience.
+ if (_virtualFileSystem.KeySet.HeaderKey.IsEmpty())
+ {
+ throw new MissingKeyException("HeaderKey is empty. Cannot decrypt NCA headers.");
+ }
+
Dictionary<ulong, List<(NcaContentType type, string path)>> updateNcas = new Dictionary<ulong, List<(NcaContentType, string)>>();
if (Directory.Exists(firmwarePackage))