feat: add .NET Framework 4.8 (net48) support#182
Open
daviddesmet wants to merge 2 commits into
Open
Conversation
Owner
Author
|
|
Owner
Author
|
Dropped Cause: |
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #182 +/- ##
==========================================
- Coverage 90.82% 90.81% -0.01%
==========================================
Files 108 112 +4
Lines 5580 5588 +8
Branches 363 363
==========================================
+ Hits 5068 5075 +7
- Misses 512 513 +1 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
Re-adds
net48as a target framework forPaseto.Core(nownet48;net8.0;net10.0), so the library can be consumed from legacy .NET Framework 4.8 apps. Closes #.Why
A user asked whether net48 could be supported. It can — net48 was targeted before and dropped around
78ee106. Both crypto dependencies (NaCl.Core,BouncyCastle.Cryptography) support netstandard2.0, so they run on net48.How
Six BCL crypto/encoding APIs used by the library don't exist on net48 and are reimplemented behind
#if NETFRAMEWORK, backed by BouncyCastle (already a dependency):HKDF.DeriveKeyHkdfBytesGenerator(Internal/Hkdf.cs)Rfc2898DeriveBytes.Pbkdf2Pkcs5S2ParametersGenerator(Internal/Pbkdf2.cs)RandomNumberGenerator.Fill/GetBytesRandomNumberGenerator.Create()(Internal/Rng.cs)CryptographicOperations.FixedTimeEqualsInternal/CryptoBytes.cs)CryptographicOperations.ZeroMemoryArray.Clearunder[NoInlining|NoOptimization]RSA.ExportRSAPrivateKey/PublicKeyProtocol/Version1.cs)Plus compiler/BCL polyfills for net48:
IsExternalInit(init setters),RuntimeHelpers.GetSubArray(array range slicing),NotNullAttribute,Guard.NotNull, and span/HashDatafallbacks inBase64UrlEncoder,EncodingHelper, andPaserkSeal.net48-only packages:
System.Memory,IndexRange,System.Text.Json, andMicrosoft.NETFramework.ReferenceAssemblies(lets net48 compile on Linux/macOS CI runners). The test project also multi-targets net48 (ReadKeyPEM handling rewritten with BouncyCastle), andbuild.cakeruns the net48 test suite on the Windows runner — the runtime security gate.Verification
GetSubArray, RSA PKCS#1 keygen/export, andReadKeyfor EC / RSA-private / RSA-public, checked against the real PASETO test-vector PEMs)Closes #99