From 5d6dce7e1f235b5193e47dbc7e4297c55aa14f66 Mon Sep 17 00:00:00 2001 From: Alex Barney Date: Tue, 17 Dec 2019 21:18:16 -0600 Subject: [PATCH] Properly pass the missing rights ID to MissingKeyException --- src/LibHac/FsSystem/NcaUtils/Nca.cs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/LibHac/FsSystem/NcaUtils/Nca.cs b/src/LibHac/FsSystem/NcaUtils/Nca.cs index 573f6bf9..d81ee843 100644 --- a/src/LibHac/FsSystem/NcaUtils/Nca.cs +++ b/src/LibHac/FsSystem/NcaUtils/Nca.cs @@ -48,9 +48,11 @@ namespace LibHac.FsSystem.NcaUtils int keyRevision = Util.GetMasterKeyRevision(Header.KeyGeneration); byte[] titleKek = Keyset.TitleKeks[keyRevision]; - if (Keyset.ExternalKeySet.Get(new RightsId(Header.RightsId), out AccessKey accessKey).IsFailure()) + var rightsId = new RightsId(Header.RightsId); + + if (Keyset.ExternalKeySet.Get(rightsId, out AccessKey accessKey).IsFailure()) { - throw new MissingKeyException("Missing NCA title key.", Header.RightsId.ToString(), KeyType.Title); + throw new MissingKeyException("Missing NCA title key.", rightsId.ToString(), KeyType.Title); } if (titleKek.IsEmpty())