Update to SHA512 file hashes

This commit is contained in:
Sean Kaim
2017-02-15 15:21:18 -05:00
parent 2849baf857
commit 69eec0135e
3 changed files with 18 additions and 5 deletions

View File

@@ -1,3 +1,16 @@
1.75 (2017-02-13):
Known Issue:
------------
File hash check will fail when updating from 1.75 Beta 1 to newer versions.
Exception will be: "MD5 Hashes didn't match!" for 1.75 Beta 1 - 1.75 RC1
Features/Enhancements:
----------------------
#344 - Use SHA512 File Hashes to validate downloads (in the update mechanism & posted to the Downloads page)
1.75 RC1 (2017-01-27):
Known Issue:

View File

@@ -18,7 +18,7 @@ Write-Host Version: $version
Write-Host dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$tag/$filename
Write-Host clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$tag/CHANGELOG.TXT
$hash = Get-FileHash -Algorithm MD5 $file | % { $_.Hash }
$hash = Get-FileHash -Algorithm SHA512 $file | % { $_.Hash }
Write-Host Checksum: $hash
@@ -38,5 +38,5 @@ Write-Host dURL: https://github.com/mRemoteNG/mRemoteNG/releases/download/$tag/$
Write-Host clURL: https://raw.githubusercontent.com/mRemoteNG/mRemoteNG/$tag/CHANGELOG.TXT
Write-Host CertificateThumbprint: 0CEA828E5C787EA8AA89268D83816C1EA03375BA
$hash = Get-FileHash -Algorithm MD5 $file | % { $_.Hash }
$hash = Get-FileHash -Algorithm SHA512 $file | % { $_.Hash }
Write-Host Checksum: $hash

View File

@@ -276,14 +276,14 @@ namespace mRemoteNG.App.Update
}
#endif
using (var md5 = MD5.Create())
using (var cksum = SHA512.Create())
{
using (var stream = File.OpenRead(CurrentUpdateInfo.UpdateFilePath))
{
var hash = md5.ComputeHash(stream);
var hash = cksum.ComputeHash(stream);
var hashString = BitConverter.ToString(hash).Replace("-", "").ToUpperInvariant();
if (!hashString.Equals(CurrentUpdateInfo.Checksum))
throw new Exception("MD5 Hashes didn't match!");
throw new Exception("SHA512 Hashes didn't match!");
}
}
}