summaryrefslogtreecommitdiff
path: root/src/core
diff options
context:
space:
mode:
authorGravatar Rodrigo Locatti2020-09-14 22:27:33 +0000
committerGravatar GitHub2020-09-14 22:27:33 +0000
commit0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971 (patch)
tree3ef2537360711465dc0b08a79aa22a4180aa4f49 /src/core
parentMerge pull request #4651 from lioncash/kernel-global (diff)
parentcrypto/key_manager: Remove dependency on the global system accessor (diff)
downloadyuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.gz
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.tar.xz
yuzu-0bac7b6a95f553fd33f3ec74e0c7f00c8bd17971.zip
Merge pull request #4652 from lioncash/crypto
crypto/key_manager: Remove dependency on the global system accessor
Diffstat (limited to 'src/core')
-rw-r--r--src/core/crypto/key_manager.cpp7
-rw-r--r--src/core/crypto/key_manager.h6
2 files changed, 8 insertions, 5 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 @@
23#include "common/hex_util.h" 23#include "common/hex_util.h"
24#include "common/logging/log.h" 24#include "common/logging/log.h"
25#include "common/string_util.h" 25#include "common/string_util.h"
26#include "core/core.h"
27#include "core/crypto/aes_util.h" 26#include "core/crypto/aes_util.h"
28#include "core/crypto/key_manager.h" 27#include "core/crypto/key_manager.h"
29#include "core/crypto/partition_data_manager.h" 28#include "core/crypto/partition_data_manager.h"
@@ -1022,10 +1021,10 @@ void KeyManager::DeriveBase() {
1022 } 1021 }
1023} 1022}
1024 1023
1025void KeyManager::DeriveETicket(PartitionDataManager& data) { 1024void KeyManager::DeriveETicket(PartitionDataManager& data,
1025 const FileSys::ContentProvider& provider) {
1026 // ETicket keys 1026 // ETicket keys
1027 const auto es = Core::System::GetInstance().GetContentProvider().GetEntry( 1027 const auto es = provider.GetEntry(0x0100000000000033, FileSys::ContentRecordType::Program);
1028 0x0100000000000033, FileSys::ContentRecordType::Program);
1029 1028
1030 if (es == nullptr) { 1029 if (es == nullptr) {
1031 return; 1030 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 {
20class IOFile; 20class IOFile;
21} 21}
22 22
23namespace FileSys {
24class ContentProvider;
25}
26
23namespace Loader { 27namespace Loader {
24enum class ResultStatus : u16; 28enum class ResultStatus : u16;
25} 29}
@@ -252,7 +256,7 @@ public:
252 256
253 bool BaseDeriveNecessary() const; 257 bool BaseDeriveNecessary() const;
254 void DeriveBase(); 258 void DeriveBase();
255 void DeriveETicket(PartitionDataManager& data); 259 void DeriveETicket(PartitionDataManager& data, const FileSys::ContentProvider& provider);
256 void PopulateTickets(); 260 void PopulateTickets();
257 void SynthesizeTickets(); 261 void SynthesizeTickets();
258 262