diff options
| author | JosJuice <josjuice@gmail.com> | 2019-08-05 13:58:27 +0200 |
|---|---|---|
| committer | JosJuice <josjuice@gmail.com> | 2019-08-06 16:32:01 +0200 |
| commit | f754a1a548f2e599e4cc2d1d799f2d21b520076f (patch) | |
| tree | 09edb3db588e2847c3c8d0ca68f3c56876d35a56 /Source/Core/DiscIO/VolumeWad.cpp | |
| parent | 24718c1a389e4f51db974575cd15c372485b92e2 (diff) | |
VolumeVerifier: Don't read data multiple times
Diffstat (limited to 'Source/Core/DiscIO/VolumeWad.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeWad.cpp | 3 |
1 files changed, 3 insertions, 0 deletions
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<u8>& 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<u8, 16> key = ticket.GetTitleKey(); mbedtls_aes_setkey_dec(&context, key.data(), 128); |
