summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorRodrigo Locatti <reinuseslisp@airmail.cc>2020-09-15 00:27:33 +0200
committerGitHub <noreply@github.com>2020-09-15 00:27:33 +0200
commit0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971 (patch)
tree3ef2537360711465dc0b08a79aa22a4180aa4f49 /src
parentMerge pull request #4651 from lioncash/kernel-global (diff)
parentcrypto/key_manager: Remove dependency on the global system accessor (diff)
downloadyuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.gz
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.bz2
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.lz
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.xz
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.zst
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.zip
Diffstat (limited to 'src')
-rw-r--r--src/core/crypto/key_manager.cpp7
-rw-r--r--src/core/crypto/key_manager.h6
-rw-r--r--src/yuzu/main.cpp6
3 files changed, 12 insertions, 7 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index dc591c730..65d246050 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -23,7 +23,6 @@
#include "common/hex_util.h"
#include "common/logging/log.h"
#include "common/string_util.h"
-#include "core/core.h"
#include "core/crypto/aes_util.h"
#include "core/crypto/key_manager.h"
#include "core/crypto/partition_data_manager.h"
@@ -1022,10 +1021,10 @@ void KeyManager::DeriveBase() {
}
}
-void KeyManager::DeriveETicket(PartitionDataManager& data) {
+void KeyManager::DeriveETicket(PartitionDataManager& data,
+ const FileSys::ContentProvider& provider) {
// ETicket keys
- const auto es = Core::System::GetInstance().GetContentProvider().GetEntry(
- 0x0100000000000033, FileSys::ContentRecordType::Program);
+ const auto es = provider.GetEntry(0x0100000000000033, FileSys::ContentRecordType::Program);
if (es == nullptr) {
return;
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h
index 321b75323..0a7220286 100644
--- a/src/core/crypto/key_manager.h
+++ b/src/core/crypto/key_manager.h
@@ -20,6 +20,10 @@ namespace Common::FS {
class IOFile;
}
+namespace FileSys {
+class ContentProvider;
+}
+
namespace Loader {
enum class ResultStatus : u16;
}
@@ -252,7 +256,7 @@ public:
bool BaseDeriveNecessary() const;
void DeriveBase();
- void DeriveETicket(PartitionDataManager& data);
+ void DeriveETicket(PartitionDataManager& data, const FileSys::ContentProvider& provider);
void PopulateTickets();
void SynthesizeTickets();
diff --git a/src/yuzu/main.cpp b/src/yuzu/main.cpp
index 68ad43a80..bb3a08ac7 100644
--- a/src/yuzu/main.cpp
+++ b/src/yuzu/main.cpp
@@ -2592,8 +2592,10 @@ void GMainWindow::OnReinitializeKeys(ReinitializeKeyBehavior behavior) {
const auto function = [this, &keys, &pdm] {
keys.PopulateFromPartitionData(pdm);
- Core::System::GetInstance().GetFileSystemController().CreateFactories(*vfs);
- keys.DeriveETicket(pdm);
+
+ auto& system = Core::System::GetInstance();
+ system.GetFileSystemController().CreateFactories(*vfs);
+ keys.DeriveETicket(pdm, system.GetContentProvider());
};
QString errors;