aboutsummaryrefslogtreecommitdiff
path: root/src/core/crypto/key_manager.cpp
diff options
context:
space:
mode:
authorbunnei <bunneidev@gmail.com>2018-08-04 21:17:10 -0400
committerGitHub <noreply@github.com>2018-08-04 21:17:10 -0400
commitcd96c04339f0b457154ae17810408a9c39959962 (patch)
tree46691894e3dab41efe835b9c7924668aecc079ef /src/core/crypto/key_manager.cpp
parent3f4fcd582e82525e3f373d8cf5129d0ace080a81 (diff)
parent0d04ee97dc0096f8b417fcbc2f3380fc580a136d (diff)
Merge pull request #921 from lioncash/view
core/crypto: Minor changes
Diffstat (limited to 'src/core/crypto/key_manager.cpp')
-rw-r--r--src/core/crypto/key_manager.cpp15
1 files changed, 4 insertions, 11 deletions
diff --git a/src/core/crypto/key_manager.cpp b/src/core/crypto/key_manager.cpp
index 678ac5752..fc45e7ab5 100644
--- a/src/core/crypto/key_manager.cpp
+++ b/src/core/crypto/key_manager.cpp
@@ -2,19 +2,16 @@
// Licensed under GPLv2 or any later version
// Refer to the license.txt file included.
+#include <algorithm>
#include <array>
#include <fstream>
#include <locale>
#include <sstream>
#include <string_view>
-#include <mbedtls/sha256.h>
-#include "common/assert.h"
#include "common/common_paths.h"
#include "common/file_util.h"
-#include "common/logging/log.h"
#include "core/crypto/key_manager.h"
#include "core/settings.h"
-#include "key_manager.h"
namespace Core::Crypto {
@@ -66,8 +63,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 +103,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))