diff options
| -rw-r--r-- | wrappers/csharp/Discovery.cs | 2 | ||||
| -rw-r--r-- | wrappers/csharp/EduVpnCommonTests/VerifyTests.cs | 4 | ||||
| -rw-r--r-- | wrappers/csharp/README.md | 3 | ||||
| -rw-r--r-- | wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java | 4 | ||||
| -rw-r--r-- | wrappers/php/tests/DiscoveryTest.php | 4 | ||||
| -rwxr-xr-x | wrappers/python/test_discovery.py | 4 | ||||
| -rw-r--r-- | wrappers/swift/Tests/EduVpnCommonTests/EduVpnCommonTests.swift | 4 |
7 files changed, 13 insertions, 12 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 diff --git a/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java b/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java index a73ac75..92a4648 100644 --- a/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java +++ b/wrappers/java-android/lib/src/test/java/org/eduvpn/common/VerifyTests.java @@ -31,7 +31,7 @@ public class VerifyTests { readAll("server_list.json.minisig"), readAll("server_list.json"), "server_list.json", - 0 + 10 ); } @@ -61,7 +61,7 @@ public class VerifyTests { readAll("server_list.json.minisig"), readAll("server_list.json"), "server_list.json", - Long.MAX_VALUE + 11 ); } diff --git a/wrappers/php/tests/DiscoveryTest.php b/wrappers/php/tests/DiscoveryTest.php index 4e4fbeb..0653eaa 100644 --- a/wrappers/php/tests/DiscoveryTest.php +++ b/wrappers/php/tests/DiscoveryTest.php @@ -21,7 +21,7 @@ class DiscoveryTest extends TestCase $this->expectNotToPerformAssertions(); Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/server_list.json.minisig'), file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 0); + 'server_list.json', 10); } public function testInvalidSignature(): void @@ -45,7 +45,7 @@ class DiscoveryTest extends TestCase $this->expectException(SignatureTooOldException::class); Discovery::verify(file_get_contents(self::TEST_DATA_DIR . '/server_list.json.minisig'), file_get_contents(self::TEST_DATA_DIR . '/server_list.json'), - 'server_list.json', 1 << 31); + 'server_list.json', 11); } public function testUnknownExpectedFileName(): void diff --git a/wrappers/python/test_discovery.py b/wrappers/python/test_discovery.py index 73c51c4..eaf68dd 100755 --- a/wrappers/python/test_discovery.py +++ b/wrappers/python/test_discovery.py @@ -22,7 +22,7 @@ class VerifyTests(unittest.TestCase): read_bytes(f"{test_data_dir}/server_list.json.minisig"), read_bytes(f"{test_data_dir}/server_list.json"), "server_list.json", - 0 + 10 ) def testValidMemoryView(self): @@ -59,7 +59,7 @@ class VerifyTests(unittest.TestCase): read_bytes(f"{test_data_dir}/server_list.json.minisig"), read_bytes(f"{test_data_dir}/server_list.json"), "server_list.json", - 1 << 31 + 11 ) self.assertEqual(ctx.exception.code, discovery.VerifyErrorCode.ErrTooOld) diff --git a/wrappers/swift/Tests/EduVpnCommonTests/EduVpnCommonTests.swift b/wrappers/swift/Tests/EduVpnCommonTests/EduVpnCommonTests.swift index 21186a9..7254509 100644 --- a/wrappers/swift/Tests/EduVpnCommonTests/EduVpnCommonTests.swift +++ b/wrappers/swift/Tests/EduVpnCommonTests/EduVpnCommonTests.swift @@ -15,7 +15,7 @@ final class EduVpnCommonTests: XCTestCase { signature: try! Data(contentsOf: URL(fileURLWithPath: "\(EduVpnCommonTests.testDataDir)/server_list.json.minisig")), signedJson: try! Data(contentsOf: URL(fileURLWithPath: "\(EduVpnCommonTests.testDataDir)/server_list.json")), expectedFileName: "server_list.json", - minSignTime: Date(timeIntervalSince1970: 0)) + minSignTime: Date(timeIntervalSince1970: 10)) } func testInvalidSignature() throws { @@ -44,7 +44,7 @@ final class EduVpnCommonTests: XCTestCase { signature: try! Data(contentsOf: URL(fileURLWithPath: "\(EduVpnCommonTests.testDataDir)/server_list.json.minisig")), signedJson: try! Data(contentsOf: URL(fileURLWithPath: "\(EduVpnCommonTests.testDataDir)/server_list.json")), expectedFileName: "server_list.json", - minSignTime: Date(timeIntervalSince1970: TimeInterval(1 << 31))), + minSignTime: Date(timeIntervalSince1970: 11)), "", {err in XCTAssertEqual(err as? VerifyErr, VerifyErr.ErrTooOld)}); } |
