diff options
| author | JMC47 <JMC4789@gmail.com> | 2020-09-06 17:14:08 -0400 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2020-09-06 17:14:08 -0400 |
| commit | e7e51756068a450b6e920c7783c81d7df4d2d133 (patch) | |
| tree | 94f0bfe833986f8d35f0d2a40842807601f53b9f /Source/Core/DiscIO/VolumeGC.cpp | |
| parent | 344fdabf23c048b81b8e87008a7a16837d180f55 (diff) | |
| parent | fc6c1931fa09513388f35507b724bc378a0758e1 (diff) | |
Merge pull request #8861 from JosJuice/netplay-hash
Make netplay's "same game" check more robust
Diffstat (limited to 'Source/Core/DiscIO/VolumeGC.cpp')
| -rw-r--r-- | Source/Core/DiscIO/VolumeGC.cpp | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/Source/Core/DiscIO/VolumeGC.cpp b/Source/Core/DiscIO/VolumeGC.cpp index 15d71c74ca..3489965395 100644 --- a/Source/Core/DiscIO/VolumeGC.cpp +++ b/Source/Core/DiscIO/VolumeGC.cpp @@ -11,6 +11,8 @@ #include <utility> #include <vector> +#include <mbedtls/sha1.h> + #include "Common/Assert.h" #include "Common/ColorUtil.h" #include "Common/CommonTypes.h" @@ -137,6 +139,19 @@ bool VolumeGC::IsDatelDisc() const return !GetBootDOLOffset(*this, PARTITION_NONE).has_value(); } +std::array<u8, 20> VolumeGC::GetSyncHash() const +{ + mbedtls_sha1_context context; + mbedtls_sha1_init(&context); + mbedtls_sha1_starts_ret(&context); + + AddGamePartitionToSyncHash(&context); + + std::array<u8, 20> hash; + mbedtls_sha1_finish_ret(&context, hash.data()); + return hash; +} + VolumeGC::ConvertedGCBanner VolumeGC::LoadBannerFile() const { GCBanner banner_file; |
