early-access version 3828

This commit is contained in:
pineappleEA
2023-08-22 19:22:27 +02:00
parent af2061a2c2
commit 3e1870d567
18 changed files with 506 additions and 213 deletions

View File

@@ -122,20 +122,18 @@ private:
}
void ImportTicket(HLERequestContext& ctx) {
const auto ticket = ctx.ReadBuffer();
const auto raw_ticket = ctx.ReadBuffer();
[[maybe_unused]] const auto cert = ctx.ReadBuffer(1);
if (ticket.size() < sizeof(Core::Crypto::Ticket)) {
if (raw_ticket.size() < sizeof(Core::Crypto::Ticket)) {
LOG_ERROR(Service_ETicket, "The input buffer is not large enough!");
IPC::ResponseBuilder rb{ctx, 2};
rb.Push(ERROR_INVALID_ARGUMENT);
return;
}
Core::Crypto::Ticket raw{};
std::memcpy(&raw, ticket.data(), sizeof(Core::Crypto::Ticket));
if (!keys.AddTicketPersonalized(raw)) {
Core::Crypto::Ticket ticket = Core::Crypto::Ticket::Read(raw_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);