summaryrefslogtreecommitdiffstats
path: root/src/core/file_sys/content_archive.cpp
diff options
context:
space:
mode:
authorLioncash <mathew1800@gmail.com>2020-09-22 23:31:53 +0200
committerLioncash <mathew1800@gmail.com>2020-09-22 23:32:33 +0200
commitff45c3957858cdf189b73e11550da06fe4337b8e (patch)
tree288ff1cc4677d6511ed8cc7e1b0db20ce2d2590f /src/core/file_sys/content_archive.cpp
parentMerge pull request #4697 from lioncash/copy5 (diff)
downloadyuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar.gz
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar.bz2
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar.lz
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar.xz
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.tar.zst
yuzu-ff45c3957858cdf189b73e11550da06fe4337b8e.zip
Diffstat (limited to 'src/core/file_sys/content_archive.cpp')
-rw-r--r--src/core/file_sys/content_archive.cpp10
1 files changed, 5 insertions, 5 deletions
diff --git a/src/core/file_sys/content_archive.cpp b/src/core/file_sys/content_archive.cpp
index 426fb6bb5..76af47ff9 100644
--- a/src/core/file_sys/content_archive.cpp
+++ b/src/core/file_sys/content_archive.cpp
@@ -323,7 +323,7 @@ bool NCA::ReadRomFSSection(const NCASectionHeader& section, const NCASectionTabl
subsection_buckets.back().entries.push_back({section.bktr.relocation.offset, {0}, ctr_low});
subsection_buckets.back().entries.push_back({size, {0}, 0});
- std::optional<Core::Crypto::Key128> key = {};
+ std::optional<Core::Crypto::Key128> key;
if (encrypted) {
if (has_rights_id) {
status = Loader::ResultStatus::Success;
@@ -442,18 +442,18 @@ std::optional<Core::Crypto::Key128> NCA::GetTitlekey() {
memcpy(rights_id.data(), header.rights_id.data(), 16);
if (rights_id == u128{}) {
status = Loader::ResultStatus::ErrorInvalidRightsID;
- return {};
+ return std::nullopt;
}
auto titlekey = keys.GetKey(Core::Crypto::S128KeyType::Titlekey, rights_id[1], rights_id[0]);
if (titlekey == Core::Crypto::Key128{}) {
status = Loader::ResultStatus::ErrorMissingTitlekey;
- return {};
+ return std::nullopt;
}
if (!keys.HasKey(Core::Crypto::S128KeyType::Titlekek, master_key_id)) {
status = Loader::ResultStatus::ErrorMissingTitlekek;
- return {};
+ return std::nullopt;
}
Core::Crypto::AESCipher<Core::Crypto::Key128> cipher(
@@ -477,7 +477,7 @@ VirtualFile NCA::Decrypt(const NCASectionHeader& s_header, VirtualFile in, u64 s
case NCASectionCryptoType::BKTR:
LOG_TRACE(Crypto, "called with mode=CTR, starting_offset={:016X}", starting_offset);
{
- std::optional<Core::Crypto::Key128> key = {};
+ std::optional<Core::Crypto::Key128> key;
if (has_rights_id) {
status = Loader::ResultStatus::Success;
key = GetTitlekey();