summaryrefslogtreecommitdiffstats
path: root/src/core/hle/service/es/es.cpp
diff options
context:
space:
mode:
authorZach Hilman <zachhilman@gmail.com>2019-04-10 20:00:39 +0200
committerZach Hilman <zachhilman@gmail.com>2019-07-08 03:38:33 +0200
commit475a7a4446b169b46d4fb34f3b022f7b369e5bf9 (patch)
tree98d7098978296365129b106c555343af9855a2a1 /src/core/hle/service/es/es.cpp
parentes: Implement ETicket ImportTicket (1) (diff)
downloadyuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar.gz
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar.bz2
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar.lz
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar.xz
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.tar.zst
yuzu-475a7a4446b169b46d4fb34f3b022f7b369e5bf9.zip
Diffstat (limited to 'src/core/hle/service/es/es.cpp')
-rw-r--r--src/core/hle/service/es/es.cpp28
1 files changed, 27 insertions, 1 deletions
diff --git a/src/core/hle/service/es/es.cpp b/src/core/hle/service/es/es.cpp
index 787927be0..65dfaa2a0 100644
--- a/src/core/hle/service/es/es.cpp
+++ b/src/core/hle/service/es/es.cpp
@@ -23,7 +23,7 @@ public:
{5, nullptr, "DeleteAllCommonTicket"},
{6, nullptr, "DeleteAllPersonalizedTicket"},
{7, nullptr, "DeleteAllPersonalizedTicketEx"},
- {8, nullptr, "GetTitleKey"},
+ {8, &ETicket::GetTitleKey, "GetTitleKey"},
{9, nullptr, "CountCommonTicket"},
{10, nullptr, "CountPersonalizedTicket"},
{11, nullptr, "ListCommonTicket"},
@@ -96,6 +96,32 @@ private:
rb.Push(RESULT_SUCCESS);
}
+ void GetTitleKey(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 key =
+ keys.GetKey(Core::Crypto::S128KeyType::Titlekey, rights_id[1], rights_id[0]);
+
+ if (key == Core::Crypto::Key128{}) {
+ LOG_ERROR(Service_ETicket,
+ "The titlekey doesn't exist in the KeyManager or the rights ID was invalid!");
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(ERROR_INVALID_RIGHTS_ID);
+ return;
+ }
+
+ ctx.WriteBuffer(key.data(), key.size());
+
+ IPC::ResponseBuilder rb{ctx, 2};
+ rb.Push(RESULT_SUCCESS);
+ }
+
};
void InstallInterfaces(SM::ServiceManager& service_manager) {