Handle CryptographicExceptions when decrypting personalized tickets

This commit is contained in:
Alex Barney 2023-01-31 23:53:33 -07:00
parent 7ee5aec746
commit c667de1169

View file

@ -1,5 +1,6 @@
using System;
using System.IO;
using System.Security.Cryptography;
using LibHac.Common;
using LibHac.Common.Keys;
using LibHac.Tools.Crypto;
@ -160,8 +161,15 @@ public class Ticket
if (keySet.ETicketRsaKey.PublicExponent.ItemsRo.IsZeros())
return null;
try
{
return CryptoOld.DecryptRsaOaep(TitleKeyBlock, keySet.ETicketRsaKeyParams);
}
catch (CryptographicException)
{
return null;
}
}
}
public enum TicketSigType