This repository has been archived by the owner on Jan 23, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4.9k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add API to enable comparision of corefx's OpenSSL with a 3rd party P/…
…Invoke (#32900) * Add OpenSslVersionNumber * Fix native compilation * Seed some API doc comments * Add a test * Move (test) PlatformDetection's OpenSslVersion into PlatformDetection.
- Loading branch information
1 parent
a7a74cd
commit 05d119e
Showing
11 changed files
with
80 additions
and
27 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
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
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
30 changes: 30 additions & 0 deletions
30
src/System.Security.Cryptography.OpenSsl/tests/SafeEvpPKeyHandleTests.cs
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,30 @@ | ||
using Xunit; | ||
|
||
namespace System.Security.Cryptography.OpenSsl.Tests | ||
{ | ||
public static class SafeEvpPKeyHandleTests | ||
{ | ||
[Fact] | ||
public static void TestOpenSslVersion() | ||
{ | ||
long version = SafeEvpPKeyHandle.OpenSslVersion; | ||
long version2 = SafeEvpPKeyHandle.OpenSslVersion; | ||
|
||
Assert.Equal(version, version2); | ||
|
||
// A value representing OpenSSL 1.0.0's development (pre-beta) build. | ||
const long MinValue = 0x10000000; | ||
|
||
// Until a platform+build is discovered which violates this constraint, assert that it | ||
// is between 1.0.0-devel and (signed) int.MaxValue as a sanity check on reading the | ||
// value. | ||
// | ||
// NOTE: The OpenSslVersion value should not be depended upon for anything other than | ||
// an equality check, to assert that a component outside of .NET Core which is utilizing | ||
// SafeEvpPKeyHandle is using the same version as .NET Core (to avoid sending the pointers | ||
// from one library into another). The exception is this test, in asserting that we're | ||
// getting "sensible" values. | ||
Assert.InRange(version, MinValue, int.MaxValue); | ||
} | ||
} | ||
} |
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