summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/es
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-10 20:08:19 +0200
committerZach Hilman <zachhilman@gmail.com>2019-07-08 03:38:33 +0200
commitb294b13584b308cdc7819cf9b4b3859ee3b9b3c2 (patch)
tree51946c2f9f6791189f46f3ef821befb8dbd678b6 /src/core/hle/service/es
parentes: Implement ETicket GetCommonTicketData (16) (diff)
downloadyuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar.gz
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar.bz2
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar.lz
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar.xz
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.tar.zst
yuzu-b294b13584b308cdc7819cf9b4b3859ee3b9b3c2.zip
Diffstat (limited to 'src/core/hle/service/es')
-rw-r--r--src/core/hle/service/es/es.cpp22
1 files changed, 21 insertions, 1 deletions
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 8a29453d7..d17fb778c 100644
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -32,7 +32,7 @@ public:
{14, &ETicket::GetCommonTicketSize, "GetCommonTicketSize"},
{15, &ETicket::GetPersonalizedTicketSize, "GetPersonalizedTicketSize"},
{16, &ETicket::GetCommonTicketData, "GetCommonTicketData"},
- {17, nullptr, "GetPersonalizedTicketData"},
+ {17, &ETicket::GetPersonalizedTicketData, "GetPersonalizedTicketData"},
{18, nullptr, "OwnTicket"},
{19, nullptr, "GetTicketInfo"},
{20, nullptr, "ListLightTicketInfo"},
@@ -241,6 +241,26 @@ private:
rb.Push<u64>(write_size);
}
+ void GetPersonalizedTicketData(Kernel::HLERequestContext& ctx) {
+ IPC::RequestParser rp{ctx};
+ const auto rights_id = rp.PopRaw<u128>();
+
+ LOG_DEBUG(Service_ETicket, "called, rights_id={:016X}{:016X}", rights_id[1], rights_id[0]);
+
+ if (!CheckRightsId(ctx, rights_id))
+ return;
+
+ const auto ticket = keys.GetPersonalizedTickets().at(rights_id);
+
+ const auto write_size = std::min(ticket.size(), ctx.GetWriteBufferSize());
+ ctx.WriteBuffer(ticket.data(), write_size);
+
+ IPC::ResponseBuilder rb{ctx, 4};
+ rb.Push(RESULT_SUCCESS);
+ rb.Push<u64>(write_size);
+ }
+
+ Core::Crypto::KeyManager keys;
};
void InstallInterfaces(SM::ServiceManager& service_manager) {