summaryrefslogtreecommitdiffstats
path: root/src/core
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2018-08-04 22:35:35 +0200
committerLioncash <mathew1800@gmail.com>2018-08-04 22:37:30 +0200
commitc1f76abfafc3723b3b216d7985ec18d895699afc (patch)
tree36f6ba4ab6c9dcc8be48ee5797688630543bb982 /src/core
parentMerge pull request #849 from DarkLordZach/xci (diff)
downloadyuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.gz
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.bz2
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.lz
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.xz
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.tar.zst
yuzu-c1f76abfafc3723b3b216d7985ec18d895699afc.zip
Diffstat (limited to 'src/core')
-rw-r--r--src/core/crypto/key_manager.cpp10
-rw-r--r--src/core/crypto/key_manager.h7
2 files changed, 7 insertions, 10 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index 678ac5752..45e7e8545 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -66,8 +66,7 @@ KeyManager::KeyManager() {
AttemptLoadKeyFile(yuzu_keys_dir, hactool_keys_dir, "title.keys", true);
}
-void KeyManager::LoadFromFile(std::string_view filename_, bool is_title_keys) {
- const auto filename = std::string(filename_);
+void KeyManager::LoadFromFile(const std::string& filename, bool is_title_keys) {
std::ifstream file(filename);
if (!file.is_open())
return;
@@ -107,11 +106,8 @@ void KeyManager::LoadFromFile(std::string_view filename_, bool is_title_keys) {
}
}
-void KeyManager::AttemptLoadKeyFile(std::string_view dir1_, std::string_view dir2_,
- std::string_view filename_, bool title) {
- const std::string dir1(dir1_);
- const std::string dir2(dir2_);
- const std::string filename(filename_);
+void KeyManager::AttemptLoadKeyFile(const std::string& dir1, const std::string& dir2,
+ const std::string& filename, bool title) {
if (FileUtil::Exists(dir1 + DIR_SEP + filename))
LoadFromFile(dir1 + DIR_SEP + filename, title);
else if (FileUtil::Exists(dir2 + DIR_SEP + filename))
diff --git a/src/core/crypto/key_manager.h b/src/core/crypto/key_manager.h
index 03152a12c..c4c53cefc 100644
--- a/src/core/crypto/key_manager.h
+++ b/src/core/crypto/key_manager.h
@@ -5,6 +5,7 @@
#pragma once
#include <array>
+#include <string>
#include <type_traits>
#include <unordered_map>
#include <vector>
@@ -109,9 +110,9 @@ private:
std::unordered_map<KeyIndex<S256KeyType>, Key256> s256_keys;
bool dev_mode;
- void LoadFromFile(std::string_view filename, bool is_title_keys);
- void AttemptLoadKeyFile(std::string_view dir1, std::string_view dir2, std::string_view filename,
- bool title);
+ void LoadFromFile(const std::string& filename, bool is_title_keys);
+ void AttemptLoadKeyFile(const std::string& dir1, const std::string& dir2,
+ const std::string& filename, bool title);
static const std::unordered_map<std::string, KeyIndex<S128KeyType>> s128_file_id;
static const std::unordered_map<std::string, KeyIndex<S256KeyType>> s256_file_id;