Skip to content
Permalink
Browse files

Force signature verification during system update from disc

Unlike the WADs people put in their game lists, these WADs
should always be correctly signed.
  • Loading branch information...
JosJuice committed Jul 19, 2019
1 parent 732d157 commit a8807e7452389b0461174868c0d69ab013601145
Showing with 8 additions and 5 deletions.
  1. +8 −5 Source/Core/Core/WiiUtils.cpp
@@ -46,7 +46,8 @@

namespace WiiUtils
{
static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad)
static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad,
IOS::HLE::Device::ES::VerifySignature verify_signature)
{
if (!wad.GetTicket().IsValid() || !wad.GetTMD().IsValid())
{
@@ -66,9 +67,9 @@ static bool ImportWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad)

while ((ret = es->ImportTicket(ticket.GetBytes(), wad.GetCertificateChain(),
IOS::HLE::Device::ES::TicketImportType::Unpersonalised,
IOS::HLE::Device::ES::VerifySignature::No)) < 0 ||
verify_signature)) < 0 ||
(ret = es->ImportTitleInit(context, tmd.GetBytes(), wad.GetCertificateChain(),
IOS::HLE::Device::ES::VerifySignature::No)) < 0)
verify_signature)) < 0)
{
if (ret != IOS::HLE::IOSC_FAIL_CHECKVALUE)
PanicAlertT("WAD installation failed: Could not initialise title import (error %d).", ret);
@@ -141,7 +142,8 @@ bool InstallWAD(IOS::HLE::Kernel& ios, const DiscIO::VolumeWAD& wad, InstallType
if (previous_temporary_title_id)
ios.GetES()->DeleteTitleContent(previous_temporary_title_id);

if (!ImportWAD(ios, wad))
// A lot of people use fakesigned WADs, so disable signature checking when installing a WAD.
if (!ImportWAD(ios, wad, IOS::HLE::Device::ES::VerifySignature::No))
return false;

// Keep track of the title ID so this title can be removed to make room for any future install.
@@ -731,7 +733,8 @@ UpdateResult DiscSystemUpdater::ProcessEntry(u32 type, std::bitset<32> attrs,
return UpdateResult::DiscReadFailed;
}
const DiscIO::VolumeWAD wad{std::move(blob)};
return ImportWAD(m_ios, wad) ? UpdateResult::Succeeded : UpdateResult::ImportFailed;
const bool success = ImportWAD(m_ios, wad, IOS::HLE::Device::ES::VerifySignature::Yes);
return success ? UpdateResult::Succeeded : UpdateResult::ImportFailed;
}

UpdateResult DoOnlineUpdate(UpdateCallback update_callback, const std::string& region)

0 comments on commit a8807e7

Please sign in to comment.
You can’t perform that action at this time.