diff options
| author | Connor McLaughlin <stenzek@gmail.com> | 2019-06-08 19:58:37 +1000 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2019-06-08 19:58:37 +1000 |
| commit | b7fba95cdfe10112d5ba92bee2c4c655ff7afa13 (patch) | |
| tree | cfbda701e10ab8dd0d6e6f7eae5d9b7581c39b89 /Source/Core/DiscIO | |
| parent | f75b254d4f31e7c7b3c96f0ac6d9c8c220e2e425 (diff) | |
| parent | 55128768422710ee78c94b45262d6825479fb484 (diff) | |
Merge pull request #8166 from lioncash/mbedtls
Externals: Update mbedTLS from 2.1.1 to 2.16.1
Diffstat (limited to 'Source/Core/DiscIO')
| -rw-r--r-- | Source/Core/DiscIO/VolumeVerifier.cpp | 14 | ||||
| -rw-r--r-- | Source/Core/DiscIO/VolumeWii.cpp | 10 |
2 files changed, 12 insertions, 12 deletions
diff --git a/Source/Core/DiscIO/VolumeVerifier.cpp b/Source/Core/DiscIO/VolumeVerifier.cpp index 9389ae0fbf..c86d9c498f 100644 --- a/Source/Core/DiscIO/VolumeVerifier.cpp +++ b/Source/Core/DiscIO/VolumeVerifier.cpp @@ -652,13 +652,13 @@ void VolumeVerifier::SetUpHashing() if (m_hashes_to_calculate.md5) { mbedtls_md5_init(&m_md5_context); - mbedtls_md5_starts(&m_md5_context); + mbedtls_md5_starts_ret(&m_md5_context); } if (m_hashes_to_calculate.sha1) { mbedtls_sha1_init(&m_sha1_context); - mbedtls_sha1_starts(&m_sha1_context); + mbedtls_sha1_starts_ret(&m_sha1_context); } } @@ -712,10 +712,10 @@ void VolumeVerifier::Process() } if (m_hashes_to_calculate.md5) - mbedtls_md5_update(&m_md5_context, data.data(), bytes_to_read); + mbedtls_md5_update_ret(&m_md5_context, data.data(), bytes_to_read); if (m_hashes_to_calculate.sha1) - mbedtls_sha1_update(&m_sha1_context, data.data(), bytes_to_read); + mbedtls_sha1_update_ret(&m_sha1_context, data.data(), bytes_to_read); } } @@ -773,7 +773,7 @@ bool VolumeVerifier::CheckContentIntegrity(const IOS::ES::Content& content) encrypted_data.data(), decrypted_data.data()); std::array<u8, 20> sha1; - mbedtls_sha1(decrypted_data.data(), content.size, sha1.data()); + mbedtls_sha1_ret(decrypted_data.data(), content.size, sha1.data()); return sha1 == content.sha1; } @@ -806,13 +806,13 @@ void VolumeVerifier::Finish() if (m_hashes_to_calculate.md5) { m_result.hashes.md5 = std::vector<u8>(16); - mbedtls_md5_finish(&m_md5_context, m_result.hashes.md5.data()); + mbedtls_md5_finish_ret(&m_md5_context, m_result.hashes.md5.data()); } if (m_hashes_to_calculate.sha1) { m_result.hashes.sha1 = std::vector<u8>(20); - mbedtls_sha1_finish(&m_sha1_context, m_result.hashes.sha1.data()); + mbedtls_sha1_finish_ret(&m_sha1_context, m_result.hashes.sha1.data()); } } diff --git a/Source/Core/DiscIO/VolumeWii.cpp b/Source/Core/DiscIO/VolumeWii.cpp index 7d44315bf1..8ab3722873 100644 --- a/Source/Core/DiscIO/VolumeWii.cpp +++ b/Source/Core/DiscIO/VolumeWii.cpp @@ -443,7 +443,7 @@ bool VolumeWii::CheckH3TableIntegrity(const Partition& partition) const return false; std::array<u8, 20> h3_table_sha1; - mbedtls_sha1(h3_table.data(), h3_table.size(), h3_table_sha1.data()); + mbedtls_sha1_ret(h3_table.data(), h3_table.size(), h3_table_sha1.data()); return h3_table_sha1 == contents[0].sha1; } @@ -481,23 +481,23 @@ bool VolumeWii::CheckBlockIntegrity(u64 block_index, const Partition& partition) for (u32 hash_index = 0; hash_index < 31; ++hash_index) { u8 h0_hash[SHA1_SIZE]; - mbedtls_sha1(cluster_data + hash_index * 0x400, 0x400, h0_hash); + mbedtls_sha1_ret(cluster_data + hash_index * 0x400, 0x400, h0_hash); if (memcmp(h0_hash, cluster_metadata + hash_index * SHA1_SIZE, SHA1_SIZE)) return false; } u8 h1_hash[SHA1_SIZE]; - mbedtls_sha1(cluster_metadata, SHA1_SIZE * 31, h1_hash); + mbedtls_sha1_ret(cluster_metadata, SHA1_SIZE * 31, h1_hash); if (memcmp(h1_hash, cluster_metadata + 0x280 + (block_index % 8) * SHA1_SIZE, SHA1_SIZE)) return false; u8 h2_hash[SHA1_SIZE]; - mbedtls_sha1(cluster_metadata + 0x280, SHA1_SIZE * 8, h2_hash); + mbedtls_sha1_ret(cluster_metadata + 0x280, SHA1_SIZE * 8, h2_hash); if (memcmp(h2_hash, cluster_metadata + 0x340 + (block_index / 8 % 8) * SHA1_SIZE, SHA1_SIZE)) return false; u8 h3_hash[SHA1_SIZE]; - mbedtls_sha1(cluster_metadata + 0x340, SHA1_SIZE * 8, h3_hash); + mbedtls_sha1_ret(cluster_metadata + 0x340, SHA1_SIZE * 8, h3_hash); if (memcmp(h3_hash, partition_details.h3_table->data() + block_index / 64 * SHA1_SIZE, SHA1_SIZE)) return false; |
