summaryrefslogtreecommitdiff
path: root/Source/Core/DiscIO/VolumeWad.cpp
diff options
context:
space:
mode:
authorConnor McLaughlin <stenzek@gmail.com>2019-08-09 22:10:09 +1000
committerGitHub <noreply@github.com>2019-08-09 22:10:09 +1000
commit2df522d4eb27961dc10c3423f52277f5d3a84234 (patch)
tree0d567c88bb397a02ef966abecca5e27a7e3c448c /Source/Core/DiscIO/VolumeWad.cpp
parent22ed2c0e0c4836fb93a5b90b017bb25180ae0e6e (diff)
parent34fb608dd6b4137ecc98e1c03228165a27eb800a (diff)
Merge pull request #8299 from JosJuice/volumeverifier-performance
VolumeVerifier: Performance improvements
Diffstat (limited to 'Source/Core/DiscIO/VolumeWad.cpp')
-rw-r--r--Source/Core/DiscIO/VolumeWad.cpp3
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);