diff options
| author | Léo Lam <leo@innovatetechnologi.es> | 2019-07-21 15:32:52 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-07-21 15:32:52 +0800 |
| commit | da1fbbc5d5d0eda5fcdccadd20207b4b525f8a7e (patch) | |
| tree | 28afb7bb2892547e824f688261ec50c0616ef15b /Source/Core/DiscIO/VolumeVerifier.cpp | |
| parent | cd7a374ab91f1f1dd46e5631309bea7ed5efc23d (diff) | |
| parent | 34f32898e63e7dd5d0251fd630f8d569432c9ac3 (diff) | |
Merge pull request #8243 from JosJuice/merge-wad-classes
DiscIO: Merge WiiWAD into VolumeWAD
Diffstat (limited to 'Source/Core/DiscIO/VolumeVerifier.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 9 |
1 files changed, 3 insertions, 6 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 5e20803651..55da0d27c6 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -770,10 +770,7 @@ void VolumeVerifier::Process() bool VolumeVerifier::CheckContentIntegrity(const IOS::ES::Content& content) { - const u64 padded_size = Common::AlignUp(content.size, 0x40); - std::vector<u8> encrypted_data(padded_size); - m_volume.Read(m_content_offsets[m_content_index], padded_size, encrypted_data.data(), - PARTITION_NONE); + std::vector<u8> encrypted_data = m_volume.GetContent(content.index); mbedtls_aes_context context; const std::array<u8, 16> key = m_volume.GetTicket(PARTITION_NONE).GetTitleKey(); @@ -783,8 +780,8 @@ bool VolumeVerifier::CheckContentIntegrity(const IOS::ES::Content& content) iv[0] = static_cast<u8>(content.index >> 8); iv[1] = static_cast<u8>(content.index & 0xFF); - std::vector<u8> decrypted_data(padded_size); - mbedtls_aes_crypt_cbc(&context, MBEDTLS_AES_DECRYPT, padded_size, iv.data(), + std::vector<u8> decrypted_data(Common::AlignUp(content.size, 0x40)); + mbedtls_aes_crypt_cbc(&context, MBEDTLS_AES_DECRYPT, decrypted_data.size(), iv.data(), encrypted_data.data(), decrypted_data.data()); std::array<u8, 20> sha1; |
