mirror of
https://github.com/dolphin-emu/dolphin.git
synced 2025-07-23 06:09:50 -06:00
IOS/ES: Move ImportTicket write function
This commit moves the write function to where it should be (IOS), especially when ES::ImportTicket() is the only place to use it. Prevents misusing the ticket import function, and removes one unsafe direct write to the NAND that does not go through IOS. This also fixes the destination path: the session root is the one which should be used for determining the ticket path, not the configured one.
This commit is contained in:
@ -248,26 +248,6 @@ void CNANDContentManager::ClearCache()
|
||||
m_map.clear();
|
||||
}
|
||||
|
||||
bool AddTicket(const IOS::ES::TicketReader& signed_ticket)
|
||||
{
|
||||
if (!signed_ticket.IsValid())
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
u64 title_id = signed_ticket.GetTitleId();
|
||||
|
||||
std::string ticket_filename = Common::GetTicketFileName(title_id, Common::FROM_CONFIGURED_ROOT);
|
||||
File::CreateFullPath(ticket_filename);
|
||||
|
||||
File::IOFile ticket_file(ticket_filename, "wb");
|
||||
if (!ticket_file)
|
||||
return false;
|
||||
|
||||
const std::vector<u8>& raw_ticket = signed_ticket.GetRawTicket();
|
||||
return ticket_file.WriteBytes(raw_ticket.data(), raw_ticket.size());
|
||||
}
|
||||
|
||||
IOS::ES::TicketReader FindSignedTicket(u64 title_id)
|
||||
{
|
||||
std::string ticket_filename = Common::GetTicketFileName(title_id, Common::FROM_CONFIGURED_ROOT);
|
||||
|
Reference in New Issue
Block a user