crypto: Streamline ticket loading.

Do not parse title key when already known, and re-use code where possible.

Offers a significant speed-up to game list population.
This commit is contained in:
Steveice10
2023-07-01 04:45:30 -07:00
parent 64f3ad2654
commit 09956e883a
4 changed files with 53 additions and 84 deletions
+1 -8
View File
@@ -133,14 +133,7 @@ private:
}
Core::Crypto::Ticket ticket = Core::Crypto::Ticket::Read(raw_ticket);
if (!ticket.IsValid()) {
LOG_ERROR(Service_ETicket, "The ticket is invalid!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ERROR_INVALID_ARGUMENT);
return;
}
if (!keys.AddTicketPersonalized(ticket)) {
if (!keys.AddTicket(ticket)) {
LOG_ERROR(Service_ETicket, "The ticket could not be imported!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ERROR_INVALID_ARGUMENT);