Properly pass the missing rights ID to MissingKeyException

This commit is contained in:
Alex Barney 2019-12-17 21:18:16 -06:00
parent d08e6b060c
commit 5d6dce7e1f

View file

@ -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())