summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2023-02-04 09:44:33 +0100
committerbunnei <bunneidev@gmail.com>2023-06-03 09:05:29 +0200
commit93bad47edb38484be11e77c5c447270badc6fb37 (patch)
treef4e20b8e2a76a90460bab318c28a524c8c101850 /src/core
parentandroid: EmulationActivity: Temporarily disable running notification. (diff)
downloadyuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar.gz
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar.bz2
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar.lz
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar.xz
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.tar.zst
yuzu-93bad47edb38484be11e77c5c447270badc6fb37.zip
Diffstat (limited to '')
-rw-r--r--src/core/crypto/key_manager.cpp8
-rw-r--r--src/core/crypto/key_manager.h3
2 files changed, 11 insertions, 0 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index 65a9fe802..0bd5859d0 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -569,6 +569,10 @@ std::optional<std::pair<Key128, Key128>> ParseTicket(const Ticket& ticket,
}
KeyManager::KeyManager() {
+ ReloadKeys();
+}
+
+void KeyManager::ReloadKeys() {
// Initialize keys
const auto yuzu_keys_dir = Common::FS::GetYuzuPath(Common::FS::YuzuPath::KeysDir);
@@ -702,6 +706,10 @@ void KeyManager::LoadFromFile(const std::filesystem::path& file_path, bool is_ti
}
}
+bool KeyManager::IsKeysLoaded() const {
+ return !s128_keys.empty() && !s256_keys.empty();
+}
+
bool KeyManager::BaseDeriveNecessary() const {
const auto check_key_existence = [this](auto key_type, u64 index1 = 0, u64 index2 = 0) {
return !HasKey(key_type, index1, index2);
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h
index 673cec463..fb991ae54 100644
--- a/src/core/crypto/key_manager.h
+++ b/src/core/crypto/key_manager.h
@@ -267,6 +267,9 @@ public:
bool AddTicketCommon(Ticket raw);
bool AddTicketPersonalized(Ticket raw);
+ void ReloadKeys();
+ bool IsKeysLoaded() const;
+
private:
KeyManager();