VolumeVerifier: Don't read data multiple times

This commit is contained in:
JosJuice
2019-08-05 13:58:27 +02:00
parent 24718c1a38
commit f754a1a548
6 changed files with 69 additions and 23 deletions

View File

@ -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);