-
Notifications
You must be signed in to change notification settings - Fork 492
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #5476 from molnard/backport1_1_12_7
[Backport v1.1.12.7] Cherry picking
- Loading branch information
Showing
12 changed files
with
62 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
using System; | ||
using System.Collections.Generic; | ||
using System.IO; | ||
using System.Runtime.InteropServices; | ||
using System.Security.Cryptography; | ||
using System.Threading; | ||
using WalletWasabi.Microservices; | ||
using Xunit; | ||
|
||
namespace WalletWasabi.Tests.UnitTests.Hwi | ||
{ | ||
public class HwiBinaryHashesTests | ||
{ | ||
/// <summary> | ||
/// Verifies HWI binaries distributed with Wasabi Wallet against checksums on https://github.com/bitcoin-core/HWI/releases/. | ||
/// </summary> | ||
/// <seealso href="https://github.com/bitcoin-core/HWI/releases/download/2.0.1/SHA256SUMS.txt.asc">Our current HWI version is 2.0.1.</seealso> | ||
[Fact] | ||
public void VerifyHwiBinaryChecksumHashes() | ||
{ | ||
using var cts = new CancellationTokenSource(5_000); | ||
|
||
Dictionary<OSPlatform, string> expectedHashes = new Dictionary<OSPlatform, string>() | ||
{ | ||
{ OSPlatform.Windows, "2cfdd6ae51e345f8c70214d626430c8d236336688a87f7d85fc6f3d6a8392da8" }, | ||
{ OSPlatform.Linux, "ca1f91593b3c0a99269ecbc0f85aced08e2dec4bf263cfb25429e047e63e38d5" }, | ||
{ OSPlatform.OSX, "389afc3927cbc6ce01f464d8d6fa66bf050d2b7d17d7127d1c1e6ee89c5b5ec1" }, | ||
}; | ||
|
||
foreach (var item in expectedHashes) | ||
{ | ||
string binaryFolder = MicroserviceHelpers.GetBinaryFolder(item.Key); | ||
string filePath = Path.Combine(binaryFolder, item.Key == OSPlatform.Windows ? "hwi.exe" : "hwi"); | ||
|
||
using SHA256 sha256 = SHA256.Create(); | ||
using FileStream fileStream = File.OpenRead(filePath); | ||
Assert.Equal(item.Value, ByteHelpers.ToHex(sha256.ComputeHash(fileStream)).ToLowerInvariant()); | ||
} | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,3 +1,3 @@ | ||
ed212d0d7dcfd3cd3736333f1c8932698db5a61e9989f1b7fd65ccc9c03ecd31 | ||
f98b80eec7e203209adbeee32c85fb824f7563845f848f27529403a744d92ec8 | ||
886960e5698cd275f81e2ad3b9654275172a30f6e9f16ddf09b6b96ad4b50403 | ||
621eb6ff196c9cd3262c3a13f8c9f2821f65083db53957bc993ae51bd3616865 | ||
efd78d3ed57072772617dfb106859f5faebe7cdf0a91ba0a7ac3976a31ce0371 | ||
13b2a562aebb29307c23fa1eee1a22dd53b941d8919695d37771b37bd75d15bf |
Binary file not shown.
Binary file not shown.
Binary file not shown.