mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-04-09 18:45:40 +00:00
Merge pull request #9019 from JosJuice/verify-wad-split-tmd-ticket
VolumeVerifier: Split TMD error from ticket error for WADs
This commit is contained in:
commit
c0fde32d80
@ -391,8 +391,6 @@ void VolumeVerifier::Start()
|
|||||||
(m_volume.GetVolumeType() == Platform::WiiDisc && !m_volume.IsEncryptedAndHashed()) ||
|
(m_volume.GetVolumeType() == Platform::WiiDisc && !m_volume.IsEncryptedAndHashed()) ||
|
||||||
IsDebugSigned();
|
IsDebugSigned();
|
||||||
|
|
||||||
if (m_volume.GetVolumeType() == Platform::WiiWAD)
|
|
||||||
CheckCorrectlySigned(PARTITION_NONE, Common::GetStringT("This title is not correctly signed."));
|
|
||||||
CheckDiscSize(CheckPartitions());
|
CheckDiscSize(CheckPartitions());
|
||||||
CheckMisc();
|
CheckMisc();
|
||||||
|
|
||||||
@ -525,10 +523,24 @@ bool VolumeVerifier::CheckPartition(const Partition& partition)
|
|||||||
|
|
||||||
if (!m_is_datel)
|
if (!m_is_datel)
|
||||||
{
|
{
|
||||||
CheckCorrectlySigned(
|
IOS::HLE::Kernel ios;
|
||||||
partition,
|
const auto es = ios.GetES();
|
||||||
StringFromFormat(Common::GetStringT("The %s partition is not correctly signed.").c_str(),
|
const std::vector<u8>& cert_chain = m_volume.GetCertificateChain(partition);
|
||||||
name.c_str()));
|
|
||||||
|
if (IOS::HLE::IPC_SUCCESS !=
|
||||||
|
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::Ticket,
|
||||||
|
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore,
|
||||||
|
m_volume.GetTicket(partition), cert_chain) ||
|
||||||
|
IOS::HLE::IPC_SUCCESS !=
|
||||||
|
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::TMD,
|
||||||
|
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore,
|
||||||
|
m_volume.GetTMD(partition), cert_chain))
|
||||||
|
{
|
||||||
|
AddProblem(
|
||||||
|
Severity::Low,
|
||||||
|
StringFromFormat(Common::GetStringT("The %s partition is not correctly signed.").c_str(),
|
||||||
|
name.c_str()));
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
if (m_volume.SupportsIntegrityCheck() && !m_volume.CheckH3TableIntegrity(partition))
|
if (m_volume.SupportsIntegrityCheck() && !m_volume.CheckH3TableIntegrity(partition))
|
||||||
@ -664,25 +676,6 @@ std::string VolumeVerifier::GetPartitionName(std::optional<u32> type) const
|
|||||||
return name;
|
return name;
|
||||||
}
|
}
|
||||||
|
|
||||||
void VolumeVerifier::CheckCorrectlySigned(const Partition& partition, std::string error_text)
|
|
||||||
{
|
|
||||||
IOS::HLE::Kernel ios;
|
|
||||||
const auto es = ios.GetES();
|
|
||||||
const std::vector<u8> cert_chain = m_volume.GetCertificateChain(partition);
|
|
||||||
|
|
||||||
if (IOS::HLE::IPC_SUCCESS !=
|
|
||||||
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::Ticket,
|
|
||||||
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore,
|
|
||||||
m_volume.GetTicket(partition), cert_chain) ||
|
|
||||||
IOS::HLE::IPC_SUCCESS !=
|
|
||||||
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::TMD,
|
|
||||||
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore,
|
|
||||||
m_volume.GetTMD(partition), cert_chain))
|
|
||||||
{
|
|
||||||
AddProblem(Severity::Low, std::move(error_text));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
bool VolumeVerifier::IsDebugSigned() const
|
bool VolumeVerifier::IsDebugSigned() const
|
||||||
{
|
{
|
||||||
const IOS::ES::TicketReader& ticket = m_volume.GetTicket(m_volume.GetGamePartition());
|
const IOS::ES::TicketReader& ticket = m_volume.GetTicket(m_volume.GetGamePartition());
|
||||||
@ -988,6 +981,30 @@ void VolumeVerifier::CheckMisc()
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (m_volume.GetVolumeType() == Platform::WiiWAD)
|
||||||
|
{
|
||||||
|
IOS::HLE::Kernel ios;
|
||||||
|
const auto es = ios.GetES();
|
||||||
|
const std::vector<u8>& cert_chain = m_volume.GetCertificateChain(PARTITION_NONE);
|
||||||
|
|
||||||
|
if (IOS::HLE::IPC_SUCCESS !=
|
||||||
|
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::Ticket,
|
||||||
|
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, m_ticket,
|
||||||
|
cert_chain))
|
||||||
|
{
|
||||||
|
// i18n: "Ticket" here is a kind of digital authorization to use a certain title (e.g. a game)
|
||||||
|
AddProblem(Severity::Low, Common::GetStringT("The ticket is not correctly signed."));
|
||||||
|
}
|
||||||
|
|
||||||
|
if (IOS::HLE::IPC_SUCCESS !=
|
||||||
|
es->VerifyContainer(IOS::HLE::Device::ES::VerifyContainerType::TMD,
|
||||||
|
IOS::HLE::Device::ES::VerifyMode::DoNotUpdateCertStore, tmd,
|
||||||
|
cert_chain))
|
||||||
|
{
|
||||||
|
AddProblem(Severity::Low, Common::GetStringT("The TMD is not correctly signed."));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
if (m_volume.IsNKit())
|
if (m_volume.IsNKit())
|
||||||
{
|
{
|
||||||
AddProblem(
|
AddProblem(
|
||||||
|
@ -148,7 +148,6 @@ private:
|
|||||||
std::vector<Partition> CheckPartitions();
|
std::vector<Partition> CheckPartitions();
|
||||||
bool CheckPartition(const Partition& partition); // Returns false if partition should be ignored
|
bool CheckPartition(const Partition& partition); // Returns false if partition should be ignored
|
||||||
std::string GetPartitionName(std::optional<u32> type) const;
|
std::string GetPartitionName(std::optional<u32> type) const;
|
||||||
void CheckCorrectlySigned(const Partition& partition, std::string error_text);
|
|
||||||
bool IsDebugSigned() const;
|
bool IsDebugSigned() const;
|
||||||
bool ShouldHaveChannelPartition() const;
|
bool ShouldHaveChannelPartition() const;
|
||||||
bool ShouldHaveInstallPartition() const;
|
bool ShouldHaveInstallPartition() const;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user