key_manager: Reduce spam from ticket database load attempts.
This commit is contained in:
parent
8440e2664d
commit
59810437a0
2 changed files with 17 additions and 11 deletions
|
@ -1189,25 +1189,30 @@ void KeyManager::DeriveETicket(PartitionDataManager& data,
|
||||||
}
|
}
|
||||||
|
|
||||||
void KeyManager::PopulateTickets() {
|
void KeyManager::PopulateTickets() {
|
||||||
if (!common_tickets.empty() && !personal_tickets.empty()) {
|
if (ticket_databases_loaded) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
ticket_databases_loaded = true;
|
||||||
|
|
||||||
|
std::vector<Ticket> tickets;
|
||||||
|
|
||||||
const auto system_save_e1_path =
|
const auto system_save_e1_path =
|
||||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e1";
|
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e1";
|
||||||
|
if (Common::FS::Exists(system_save_e1_path)) {
|
||||||
const Common::FS::IOFile save_e1{system_save_e1_path, Common::FS::FileAccessMode::Read,
|
const Common::FS::IOFile save_e1{system_save_e1_path, Common::FS::FileAccessMode::Read,
|
||||||
Common::FS::FileType::BinaryFile};
|
Common::FS::FileType::BinaryFile};
|
||||||
|
const auto blob1 = GetTicketblob(save_e1);
|
||||||
|
tickets.insert(tickets.end(), blob1.begin(), blob1.end());
|
||||||
|
}
|
||||||
|
|
||||||
const auto system_save_e2_path =
|
const auto system_save_e2_path =
|
||||||
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e2";
|
Common::FS::GetYuzuPath(Common::FS::YuzuPath::NANDDir) / "system/save/80000000000000e2";
|
||||||
|
if (Common::FS::Exists(system_save_e2_path)) {
|
||||||
const Common::FS::IOFile save_e2{system_save_e2_path, Common::FS::FileAccessMode::Read,
|
const Common::FS::IOFile save_e2{system_save_e2_path, Common::FS::FileAccessMode::Read,
|
||||||
Common::FS::FileType::BinaryFile};
|
Common::FS::FileType::BinaryFile};
|
||||||
|
|
||||||
auto tickets = GetTicketblob(save_e1);
|
|
||||||
const auto blob2 = GetTicketblob(save_e2);
|
const auto blob2 = GetTicketblob(save_e2);
|
||||||
tickets.insert(tickets.end(), blob2.begin(), blob2.end());
|
tickets.insert(tickets.end(), blob2.begin(), blob2.end());
|
||||||
|
}
|
||||||
|
|
||||||
for (const auto& ticket : tickets) {
|
for (const auto& ticket : tickets) {
|
||||||
AddTicket(ticket);
|
AddTicket(ticket);
|
||||||
|
|
|
@ -304,6 +304,7 @@ private:
|
||||||
// Map from rights ID to ticket
|
// Map from rights ID to ticket
|
||||||
std::map<u128, Ticket> common_tickets;
|
std::map<u128, Ticket> common_tickets;
|
||||||
std::map<u128, Ticket> personal_tickets;
|
std::map<u128, Ticket> personal_tickets;
|
||||||
|
bool ticket_databases_loaded = false;
|
||||||
|
|
||||||
std::array<std::array<u8, 0xB0>, 0x20> encrypted_keyblobs{};
|
std::array<std::array<u8, 0xB0>, 0x20> encrypted_keyblobs{};
|
||||||
std::array<std::array<u8, 0x90>, 0x20> keyblobs{};
|
std::array<std::array<u8, 0x90>, 0x20> keyblobs{};
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue