If you attempt to use any of the *OpenSsl primitives on macOS, this will currently abort the whole process.
This changes them to check for OpenSSL's presence and throw an appropriate exception instead of aborting.
When used as an internal implementation, the aborting behavior remains.
This change moves the RSAOpenSsl class (and the RSA.Create() internal class on Linux) to use EVP_PKEY
for the import and export operations, making the interaction with the underlying library based on
PKCS#8 PrivateKeyInfo and X.509 SubjectPublicKeyInfo key blobs.
A large portion of the code is just from splitting the key helpers files to not need all of the encrypted PKCS#8 support
in the System.Security.Cryptography.OpenSsl library, as the encrypted PKCS#8 <-> unencrypted PKCS#8 work provided
by the base classes is sufficient.
Once PKCS#8 and SPKI became the primary modes of interaction the spanified import and export routines for those got
overridden in RSAOpenSsl to avoid SPKI->RSAParameters->SPKI-style conversions.
This change completely eliminates SafeRsaHandle, and the only time that an `RSA*` is used at all is in the legacy RSAOpenSsl(IntPtr) constructor.
* Dead end S.Security.Cryptography.OpenSsl package
To reduce complexity of the cryptography OpenSsl library, dead ending
its package as most of the configurations are partial facades anyway and
adding OpenSsl to the targeting pack. It's already part of the runtime
and exposed in aspnetcore's targeting pack.
.NET Standard libraries can continue to use the latest available package
which harvests for .NET Standard configurations.
Contributes to https://github.com/dotnet/runtime/issues/47530
* Fix cofactor import and disable tests that require the ability to derive a new public key from a private key + curve + generator, order, and cofactor.
* Add missing member.
* Disable more tests against CanDeriveNewPublicKey.
* Use isSupported instead of ConditionalFact.
* Fix net47 build.
* Disable RC2 tests on Android. RC2 isn't supported by Android.
* Use PlatformSpecific attribute instead of SkipOnMono.
* Skip key file tests that use RC2 encryption on Android
* Use ConditionalFact instead of PlatformSpecific.
* Reorganize usings and fix build failure.
* Add RC2Provider.cs to OpenSSL tests to fill in the RC2Factory type.
* Fix windows build.
* Update public SafeHandle types to have public parameterless constructors.
Remove now-unneeded ILLink trim files.
Make public abstract SafeHandle constructors protected.
Remove comment on SafeWaitHandle
* Make SafeHandle constructors public for internal types.
Make internal abstract SafeHandle default constructors protected. Make non-abstract internal SafeHandles sealed when possible.
More internal SafeHandle types.
* Add new Marshal.InitHandle API.
Fix SetHandle accessibility
Fix test.
Use Marshal.InitHandle.
* PR feedback.
* Remove trailing whitespace.
* disable vs restore in vs for projects targeting platform specific older frameworks
* Add infra to auto-update solution files for restore
* Add NuGet.config files for solutions affected by restore issue
Co-authored-by: Viktor Hofer <[email protected]>
* Mark System.Security.Cryptography.OpenSsl as unsupported on browser
* Mark other System.Security.Cryptography APIs as unsupported on browser
* Mark System.Data.Odbc.* as unsupported on browser
* Mark System.DirectoryServices.Protocols APIs as unsupported on browser
* Mark System.Drawing.Common APIs as unsupported on browser
* Mark System.IO.Ports as unsupported on browser
- Remove depprojs which currently binplace external references into the RefPath folders in favor of PackageReference and PackageDownload items.
- Build all configurations by default when building an individual project (either on the CLI or inside VS) same as with the official SDK. This enables .NETFramework Test Explorer support.
- Centrally define libraries that compose the shared framework instead of in each Directory.Build.props file to be able to build the targeting pack first and consume it in the OOB libraries.
- Use ProjectReferences to reference OOB projects. Compile against the reference assembly but use the implementation assembly app-local during runtime.
- Remove OOBs from the testhost and remove the testhost folder for .NETFramework as it isn't required anymore.
- Only binplace for $(NetCoreAppCurrent) to compose a) the targeting pack, b) the runtime pack, c) the testhost, d) a full closure for the shims.
- Use Targeting Packs for OOB projects (with their implicit assembly references) but still explicitly define granular references for .NETCoreApp configurations (DisableImplicitAssemblyReferences switch). Use the implicit targeting pack references in some Microsoft.Extensions.* cases.
- Remove placeholder configurations as they aren't needed anymore with explicit P2Ps vs Targeting Pack references.
- Remove implicit assembly references (ie for .NETFramework, mscorlib)
- Remove AssemblySearchPath hacks that were introduced with b7c4cb7 as the targeting pack is now used by default.
- Reduce unnecessary .NETFramework configurations that were added to run tests in favor of the already existing ref&src configurations.
- Stop hardcoding the paths for wasm assemblies and use the returned TargetPath of the ProjectReferences.
- Addressed formatting (ItemGroups, References at the bottom of the project file, ordering of references, use LibrariesProjectRoot instead of a relative path, unnecessary AssemblyName and RootNamespace properties which are identical to the project name, ordering of tfms)
- Revert "fix clean (#33758)"
* Porting new netfx configurations for packages
* Add Netfx configurations to Microsoft.Extensions and missing System packages
* Making sure net461 configurations build against targeting pack assembly versions
* Undo changes to add netfx configurations on reference projects that don't ship in their package
* Fix issue with M.E.FP.P package by removing NetStandard.Library metapackage dependency
* Fix issues with depending on higher version than the one available in net461
* Disable UTF8String verifyClosure on package
* Undo changes to Microsoft.XmlSerializer.Generator
* Update src/libraries/Microsoft.Extensions.FileProviders.Physical/src/Microsoft.Extensions.FileProviders.Physical.csproj
Co-authored-by: Eric StJohn <[email protected]>
Co-authored-by: Eric StJohn <[email protected]>
Since the entire set of System.Security.Cryptography.* tests has been disabled on WASM recently in https://github.com/dotnet/runtime/pull/37723, we need to let everyone know that those areas are not quite supported on WASM at the moment. In that case System.Security.Cryptography classes could throw PlatformNotSupportedException until some solution comes (https://github.com/dotnet/runtime/issues/37669)
* Move current ASN src and tests into new tree with no modifications
AsnReader partials are named AsnDecoder to better match the final name
for the core logic they contain.
* Make System.Formats.Asn1 package
* Apply changes from API review
Some additional tests were written to increase code coverage after the changes
* Move AsnReader consumers to public API
If D (private key) is supplied but not the public key (Q), permit
this and allow the platform to re-calculate the public key from
the private key.
* Windows uses CNG blobs with the Q.X and Q.Y values set to (0,0).
* LInux uses the ECC math module to recompute Q from D and G.
* macOS is TBD.
This change adds overloads for SignData and SignHash/ComputeSignature on the DSA and ECDsa classes to make it easier for callers that need to use RFC3279's signature format to work with the classes in .NET.
It also moves more temporary work from temporary buffers to stackallocs.
Co-authored-by: Jeremy Barton <[email protected]>
* libraries -restore for vertical build without test restore
* Automatic test change and regex to remove the addition of an extra line at eof
* manual test restore fixed (restore completely done for vertical build)
* build native done
* Automatic ref change and regex to remove the last line
* manual reference assebly change and generated shims build
* automatic src change and regex
* native bin place and src build manual change
* apicompat and pretest.csproj done
* fixing the package build
* fixing all config
* packaging and feedback
* adding back placeholder configuration
* fixing the shims
* delete configuration.props
* making the build work in master
* Test Change
* fixing the packageing, test restore replacing TargetFramework -> OriginalTargetFramework
* delete test configuraiton.props, trailing semicolon and use targetFramework
* reverting the package change
* enable apicompat and fixing configurationGroup for individual projects
* fixing the api compat
* making ilproj work
* adding the outerBuildTest
* adding the arcade package version
* fixing the merge conflicts
* minor changes
* adding additional configs and setting the runtimeOS
* making the vs stuff work
* removing the target Group to fix the apicompat
* fixing the linux build and some minor changes
* making additionalBuildTargetFramework LOcalProperty
* fixing the allConfigurations build
* fixing the netfx build
* fixing package Testing and restore
* Missing TargetFrameworks tag
* making the VSdesgin stuff work
* Remove OriginalFramework Entirely
* some minor pr feedback
* RemoveExtraSemicolon
* use boolean exclude flag
* fixing yml scripts to pass tests
* adding comments and some minor feedback
* moving packaging property to correct plave
* fixing the build for web assembly
* Fixing the live ci build
* Fixing the live build for shims
* fixing the tests
* fixing the packaging and enterprise linux
* fixing package sizes
* Fix the targetFramework
* updating the targetFramework sdl
* removing the buildOS and be able to use OSGroup as done in the old system
* Fixing the osgroup stuff for send to helix task
* Fix OSX failures
* Fixing the osx build
* uploading tmp folder to artifacts
* running restore for runtime.deproj correctly