From f754a1a548f2e599e4cc2d1d799f2d21b520076f Mon Sep 17 00:00:00 2001 From: JosJuice Date: Mon, 5 Aug 2019 13:58:27 +0200 Subject: VolumeVerifier: Don't read data multiple times --- Source/Core/DiscIO/VolumeWad.cpp | 3 +++ 1 file changed, 3 insertions(+) (limited to 'Source/Core/DiscIO/VolumeWad.cpp') diff --git a/Source/Core/DiscIO/VolumeWad.cpp b/Source/Core/DiscIO/VolumeWad.cpp index cc83f59081..e471edcd1d 100644 --- a/Source/Core/DiscIO/VolumeWad.cpp +++ b/Source/Core/DiscIO/VolumeWad.cpp @@ -156,6 +156,9 @@ bool VolumeWAD::CheckContentIntegrity(const IOS::ES::Content& content, const std::vector& encrypted_data, const IOS::ES::TicketReader& ticket) const { + if (encrypted_data.size() != Common::AlignUp(content.size, 0x40)) + return false; + mbedtls_aes_context context; const std::array key = ticket.GetTitleKey(); mbedtls_aes_setkey_dec(&context, key.data(), 128); -- cgit v1.2.3