summaryrefslogtreecommitdiff
path: root/wrappers/csharp
diff options
context:
space:
mode:
authorStevenWdV <stevenwdv@gmail.com>2022-02-09 17:02:20 +0100
committerStevenWdV <stevenwdv@gmail.com>2022-02-09 17:02:20 +0100
commite0228bca0f8cc2133a4efbbc5ed62bf01fda3783 (patch)
tree729d7cc508ab167a8f529f2faad1653996b5b371 /wrappers/csharp
parent19b583d03d3a9e654e149db971f1c752ad807f46 (diff)
Improve wrapper min sign time tests, add .NET version note
Diffstat (limited to 'wrappers/csharp')
-rw-r--r--wrappers/csharp/Discovery.cs2
-rw-r--r--wrappers/csharp/EduVpnCommonTests/VerifyTests.cs4
-rw-r--r--wrappers/csharp/README.md3
3 files changed, 5 insertions, 4 deletions
diff --git a/wrappers/csharp/Discovery.cs b/wrappers/csharp/Discovery.cs
index da4a6ea..21c979f 100644
--- a/wrappers/csharp/Discovery.cs
+++ b/wrappers/csharp/Discovery.cs
@@ -22,7 +22,7 @@ namespace EduVpnCommon
/// <exception cref="ArgumentException">If <c>expectedFileName</c> is not one of the allowed values.</exception>
/// <exception cref="VerifyException">If signature verification fails.</exception>
public static void Verify(
- ArraySegment<byte> signatureFileContent,
+ ArraySegment<byte> signatureFileContent, // Span<byte> would be nicer, but is not available in .NET Standard 2.0
ArraySegment<byte> signedJson,
string expectedFileName,
DateTimeOffset minSignTime)
diff --git a/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs b/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs
index 2d4a565..c41696b 100644
--- a/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs
+++ b/wrappers/csharp/EduVpnCommonTests/VerifyTests.cs
@@ -24,7 +24,7 @@ namespace EduVpnCommonTests
File.ReadAllBytes($"{testDataDir_}/{sigFile}"),
File.ReadAllBytes($"{testDataDir_}/{jsonFile}"),
expectedFileName,
- DateTimeOffset.UnixEpoch);
+ DateTimeOffset.FromUnixTimeSeconds(10));
[Test]
[TestCase("server_list.json.minisig", "server_list.json", "server_list.json")]
@@ -67,7 +67,7 @@ namespace EduVpnCommonTests
File.ReadAllBytes($"{testDataDir_}/{sigFile}"),
File.ReadAllBytes($"{testDataDir_}/{jsonFile}"),
expectedFileName,
- DateTimeOffset.MaxValue));
+ DateTimeOffset.FromUnixTimeSeconds(11)));
[Test]
[TestCase("other_list.json.minisig", "other_list.json", "other_list.json")]
diff --git a/wrappers/csharp/README.md b/wrappers/csharp/README.md
index 553b123..1ff1123 100644
--- a/wrappers/csharp/README.md
+++ b/wrappers/csharp/README.md
@@ -4,7 +4,8 @@
You will need to install the [.NET SDK](https://dotnet.microsoft.com/download), which includes the `dotnet` tool. The
wrapper targets .NET Standard 2.0, which means that at least .NET Core 2.0 is required (.NET 5+ is also fine). For the
-tests, .NET 5 is required.
+tests, .NET 5 is required. (Or change `<TargetFramework>` in EduVpnCommonTests.csproj to e.g. `net6.0` to use newer
+versions.)
## Build & test