Allow the user to ignore signature issues during WAD import
Improves usability with signature checks.
This commit is contained in:
parent
c08806d107
commit
6503a9f538
|
@ -5,6 +5,7 @@
|
||||||
#include "UICommon/WiiUtils.h"
|
#include "UICommon/WiiUtils.h"
|
||||||
#include "Common/CommonTypes.h"
|
#include "Common/CommonTypes.h"
|
||||||
#include "Common/MsgHandler.h"
|
#include "Common/MsgHandler.h"
|
||||||
|
#include "Core/ConfigManager.h"
|
||||||
#include "Core/IOS/ES/ES.h"
|
#include "Core/IOS/ES/ES.h"
|
||||||
#include "Core/IOS/ES/Formats.h"
|
#include "Core/IOS/ES/Formats.h"
|
||||||
#include "Core/IOS/IOS.h"
|
#include "Core/IOS/IOS.h"
|
||||||
|
@ -27,12 +28,23 @@ bool InstallWAD(const std::string& wad_path)
|
||||||
const auto es = ios.GetES();
|
const auto es = ios.GetES();
|
||||||
|
|
||||||
IOS::HLE::Device::ES::Context context;
|
IOS::HLE::Device::ES::Context context;
|
||||||
if (es->ImportTicket(wad.GetTicket().GetBytes(), wad.GetCertificateChain()) < 0 ||
|
IOS::HLE::ReturnCode ret;
|
||||||
es->ImportTitleInit(context, tmd.GetBytes(), wad.GetCertificateChain()) < 0)
|
const bool checks_enabled = SConfig::GetInstance().m_enable_signature_checks;
|
||||||
|
while ((ret = es->ImportTicket(wad.GetTicket().GetBytes(), wad.GetCertificateChain())) < 0 ||
|
||||||
|
(ret = es->ImportTitleInit(context, tmd.GetBytes(), wad.GetCertificateChain())) < 0)
|
||||||
{
|
{
|
||||||
|
if (checks_enabled && ret == IOS::HLE::IOSC_FAIL_CHECKVALUE &&
|
||||||
|
AskYesNoT("This WAD has not been signed by Nintendo. Continue to import?"))
|
||||||
|
{
|
||||||
|
SConfig::GetInstance().m_enable_signature_checks = false;
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
|
SConfig::GetInstance().m_enable_signature_checks = checks_enabled;
|
||||||
PanicAlertT("WAD installation failed: Could not initialise title import.");
|
PanicAlertT("WAD installation failed: Could not initialise title import.");
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
SConfig::GetInstance().m_enable_signature_checks = checks_enabled;
|
||||||
|
|
||||||
const bool contents_imported = [&]() {
|
const bool contents_imported = [&]() {
|
||||||
const u64 title_id = tmd.GetTitleId();
|
const u64 title_id = tmd.GetTitleId();
|
||||||
|
|
Loading…
Reference in New Issue