mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-30 09:39:46 -06:00
Force ticket to have a correct key index for importing
This commit changes the import code to ensure the common key index in the ticket is correct, as it's checked by IOS.
This commit is contained in:
@ -54,7 +54,12 @@ bool InstallWAD(const std::string& wad_path)
|
||||
IOS::HLE::Device::ES::Context context;
|
||||
IOS::HLE::ReturnCode ret;
|
||||
const bool checks_enabled = SConfig::GetInstance().m_enable_signature_checks;
|
||||
while ((ret = es->ImportTicket(wad.GetTicket().GetBytes(), wad.GetCertificateChain())) < 0 ||
|
||||
|
||||
IOS::ES::TicketReader ticket = wad.GetTicket();
|
||||
// Ensure the common key index is correct, as it's checked by IOS.
|
||||
ticket.FixCommonKeyIndex();
|
||||
|
||||
while ((ret = es->ImportTicket(ticket.GetBytes(), wad.GetCertificateChain())) < 0 ||
|
||||
(ret = es->ImportTitleInit(context, tmd.GetBytes(), wad.GetCertificateChain())) < 0)
|
||||
{
|
||||
if (checks_enabled && ret == IOS::HLE::IOSC_FAIL_CHECKVALUE &&
|
||||
|
Reference in New Issue
Block a user