diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/core/crypto/aes_util.cpp | 6 | ||||
-rw-r--r-- | src/core/crypto/aes_util.h | 8 | ||||
-rw-r--r-- | src/core/file_sys/program_metadata.h | 6 | ||||
-rw-r--r-- | src/core/hle/service/acc/acc.cpp | 4 | ||||
-rw-r--r-- | src/core/hle/service/lbl/lbl.cpp | 2 | ||||
-rw-r--r-- | src/core/hle/service/lm/lm.cpp | 13 |
6 files changed, 18 insertions, 21 deletions
diff --git a/src/core/crypto/aes_util.cpp b/src/core/crypto/aes_util.cpp index cb7506241..85a666de9 100644 --- a/src/core/crypto/aes_util.cpp +++ b/src/core/crypto/aes_util.cpp @@ -119,9 +119,9 @@ void AESCipher<Key, KeySize>::XTSTranscode(const u8* src, std::size_t size, u8* } template <typename Key, std::size_t KeySize> -void AESCipher<Key, KeySize>::SetIVImpl(const u8* data, std::size_t size) { - ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data, size) || - mbedtls_cipher_set_iv(&ctx->decryption_context, data, size)) == 0, +void AESCipher<Key, KeySize>::SetIV(std::span<const u8> data) { + ASSERT_MSG((mbedtls_cipher_set_iv(&ctx->encryption_context, data.data(), data.size()) || + mbedtls_cipher_set_iv(&ctx->decryption_context, data.data(), data.size())) == 0, "Failed to set IV on mbedtls ciphers."); } diff --git a/src/core/crypto/aes_util.h b/src/core/crypto/aes_util.h index e2a304186..230451b8f 100644 --- a/src/core/crypto/aes_util.h +++ b/src/core/crypto/aes_util.h @@ -5,6 +5,7 @@ #pragma once #include <memory> +#include <span> #include <type_traits> #include "common/common_types.h" #include "core/file_sys/vfs.h" @@ -33,10 +34,7 @@ public: AESCipher(Key key, Mode mode); ~AESCipher(); - template <typename ContiguousContainer> - void SetIV(const ContiguousContainer& container) { - SetIVImpl(std::data(container), std::size(container)); - } + void SetIV(std::span<const u8> data); template <typename Source, typename Dest> void Transcode(const Source* src, std::size_t size, Dest* dest, Op op) const { @@ -60,8 +58,6 @@ public: std::size_t sector_size, Op op); private: - void SetIVImpl(const u8* data, std::size_t size); - std::unique_ptr<CipherContext> ctx; }; } // namespace Core::Crypto diff --git a/src/core/file_sys/program_metadata.h b/src/core/file_sys/program_metadata.h index c505f5a89..1eee916be 100644 --- a/src/core/file_sys/program_metadata.h +++ b/src/core/file_sys/program_metadata.h @@ -44,6 +44,12 @@ public: ProgramMetadata(); ~ProgramMetadata(); + ProgramMetadata(const ProgramMetadata&) = default; + ProgramMetadata& operator=(const ProgramMetadata&) = default; + + ProgramMetadata(ProgramMetadata&&) = default; + ProgramMetadata& operator=(ProgramMetadata&&) = default; + /// Gets a default ProgramMetadata configuration, should only be used for homebrew formats where /// we do not have an NPDM file static ProgramMetadata GetDefault(); diff --git a/src/core/hle/service/acc/acc.cpp b/src/core/hle/service/acc/acc.cpp index 52535ecc0..5450dcf0f 100644 --- a/src/core/hle/service/acc/acc.cpp +++ b/src/core/hle/service/acc/acc.cpp @@ -702,16 +702,12 @@ void Module::Interface::IsUserRegistrationRequestPermitted(Kernel::HLERequestCon } void Module::Interface::InitializeApplicationInfo(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - LOG_DEBUG(Service_ACC, "called"); IPC::ResponseBuilder rb{ctx, 2}; rb.Push(InitializeApplicationInfoBase()); } void Module::Interface::InitializeApplicationInfoRestricted(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; - LOG_WARNING(Service_ACC, "(Partial implementation) called"); // TODO(ogniK): We require checking if the user actually owns the title and what not. As of diff --git a/src/core/hle/service/lbl/lbl.cpp b/src/core/hle/service/lbl/lbl.cpp index f4490f3d9..e11a0c45a 100644 --- a/src/core/hle/service/lbl/lbl.cpp +++ b/src/core/hle/service/lbl/lbl.cpp @@ -79,7 +79,6 @@ private: } void GetCurrentBrightnessSetting(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; auto brightness = current_brightness; if (!std::isfinite(brightness)) { LOG_ERROR(Service_LBL, "Brightness is infinite!"); @@ -272,7 +271,6 @@ private: } void GetCurrentBrightnessSettingForVrMode(Kernel::HLERequestContext& ctx) { - IPC::RequestParser rp{ctx}; auto brightness = current_vr_brightness; if (!std::isfinite(brightness)) { LOG_ERROR(Service_LBL, "Brightness is infinite!"); diff --git a/src/core/hle/service/lm/lm.cpp b/src/core/hle/service/lm/lm.cpp index 7d7542fc2..9bcf8870d 100644 --- a/src/core/hle/service/lm/lm.cpp +++ b/src/core/hle/service/lm/lm.cpp @@ -46,7 +46,7 @@ struct hash<Service::LM::LogPacketHeaderEntry> { boost::hash_combine(seed, k.severity); boost::hash_combine(seed, k.verbosity); return seed; - }; + } }; } // namespace std @@ -95,7 +95,7 @@ private: std::memcpy(&header, data.data(), sizeof(LogPacketHeader)); offset += sizeof(LogPacketHeader); - LogPacketHeaderEntry entry{ + const LogPacketHeaderEntry entry{ .pid = header.pid, .tid = header.tid, .severity = header.severity, @@ -105,16 +105,17 @@ private: if (True(header.flags & LogPacketFlags::Head)) { std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); std::memcpy(tmp.data(), data.data() + offset, tmp.size()); - entries[entry] = std::move(tmp); + entries.insert_or_assign(entry, std::move(tmp)); } else { + const auto entry_iter = entries.find(entry); + // Append to existing entry - if (!entries.contains(entry)) { + if (entry_iter == entries.cend()) { LOG_ERROR(Service_LM, "Log entry does not exist!"); return; } - std::vector<u8> tmp(data.size() - sizeof(LogPacketHeader)); - auto& existing_entry = entries[entry]; + auto& existing_entry = entry_iter->second; const auto base = existing_entry.size(); existing_entry.resize(base + (data.size() - sizeof(LogPacketHeader))); std::memcpy(existing_entry.data() + base, data.data() + offset, |