|
|
@ -199,7 +199,7 @@ Key256 KeyManager::GetKey(S256KeyType id, u64 field1, u64 field2) const {
|
|
|
|
|
|
|
|
|
|
|
|
template <size_t Size>
|
|
|
|
template <size_t Size>
|
|
|
|
void KeyManager::WriteKeyToFile(bool title_key, std::string_view keyname,
|
|
|
|
void KeyManager::WriteKeyToFile(bool title_key, std::string_view keyname,
|
|
|
|
std::array<u8, Size> key) {
|
|
|
|
const std::array<u8, Size>& key) {
|
|
|
|
const std::string yuzu_keys_dir = FileUtil::GetUserPath(FileUtil::UserPath::KeysDir);
|
|
|
|
const std::string yuzu_keys_dir = FileUtil::GetUserPath(FileUtil::UserPath::KeysDir);
|
|
|
|
std::string filename = "title.keys_autogenerated";
|
|
|
|
std::string filename = "title.keys_autogenerated";
|
|
|
|
if (!title_key)
|
|
|
|
if (!title_key)
|
|
|
@ -209,11 +209,10 @@ void KeyManager::WriteKeyToFile(bool title_key, std::string_view keyname,
|
|
|
|
if (!file.is_open())
|
|
|
|
if (!file.is_open())
|
|
|
|
return;
|
|
|
|
return;
|
|
|
|
if (add_info_text) {
|
|
|
|
if (add_info_text) {
|
|
|
|
file << "# This file is autogenerated by Yuzu" << std::endl
|
|
|
|
file
|
|
|
|
<< "# It serves to store keys that were automatically generated from the normal keys"
|
|
|
|
<< "# This file is autogenerated by Yuzu\n"
|
|
|
|
<< std::endl
|
|
|
|
<< "# It serves to store keys that were automatically generated from the normal keys\n"
|
|
|
|
<< "# If you are experiencing issues involving keys, it may help to delete this file"
|
|
|
|
<< "# If you are experiencing issues involving keys, it may help to delete this file\n";
|
|
|
|
<< std::endl;
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
file << std::endl
|
|
|
|
file << std::endl
|
|
|
@ -263,11 +262,12 @@ bool KeyManager::KeyFileExists(bool title) {
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
void KeyManager::DeriveSDSeedLazy() {
|
|
|
|
void KeyManager::DeriveSDSeedLazy() {
|
|
|
|
if (!HasKey(S128KeyType::SDSeed)) {
|
|
|
|
if (HasKey(S128KeyType::SDSeed))
|
|
|
|
|
|
|
|
return;
|
|
|
|
|
|
|
|
|
|
|
|
const auto res = DeriveSDSeed();
|
|
|
|
const auto res = DeriveSDSeed();
|
|
|
|
if (res != boost::none)
|
|
|
|
if (res != boost::none)
|
|
|
|
SetKey(S128KeyType::SDSeed, res.get());
|
|
|
|
SetKey(S128KeyType::SDSeed, res.get());
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
const boost::container::flat_map<std::string, KeyIndex<S128KeyType>> KeyManager::s128_file_id = {
|
|
|
|
const boost::container::flat_map<std::string, KeyIndex<S128KeyType>> KeyManager::s128_file_id = {
|
|
|
|