Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make CryptQueryObject call compliant to interop guidelines #60218

Closed
wants to merge 309 commits into from

Conversation

pedrobsaila
Copy link
Contributor

@pedrobsaila pedrobsaila commented Oct 9, 2021

Fixes partially issue #51564
(this issue is still under progress, more PRs are to come)

This PR makes the following calls compliant with Interop gudielines :

  • Crypt32.CryptQueryObject
  • Crypt32.CertGetCertificateContextProperty
  • Crypt32.CertDuplicateCertificateContext

I know the PR should be small, but it's barely the minimum to move CryptQueryObject : this call uses many struct/enum/class and safe handles, that should either also be moved to Common folder.or deleted because they already exists there (so we need to reuse the later)

There's a change to CERT_INFO class inside Common folder, so it uses the created struct FILENAME (like CERT_INFO inside System.Security.Cryptography.X509Certificates\src\Internal\Cryptography\Pal.Windows\Native\Primitives.cs), using CERT_INFO with COM FILENAME causes overflows in tests since it uses int instead of uint.

I create this file Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty_NO_NULLABLE.cs instead of reusing Common/src/Interop/Windows/Crypt32/Interop.CertGetCertificateContextProperty.cs because it's referenced by System.Windows.Extensions which does not support nullable yet

jkoritzinsky and others added 30 commits December 9, 2020 17:42
- array: out byref, return/out with element marshalling
- bool: in by ref, default marshalling
- char: in by ref
- SafeHandle: out by ref

Commit migrated from dotnet/runtimelab@a072658
…rsions. (dotnet/runtimelab#944)

Centralize package versions in Versions.props so we have one point for updating a given package across the whole repo.

Commit migrated from dotnet/runtimelab@9aac138
* Update to Arcade 6.0.0-beta.21222.1

* Set DNNE roll forward to Major so that we can build with 6.0 SDK

Commit migrated from dotnet/runtimelab@cd7b25b
…net/runtimelab#1031)

* Fix runsettings generation

* Update standalone-template for recent infrastructure changes (dotnet/runtimelab#1024)

* Update to Arcade 6.0.0-beta.21226.16

* Update dependency for using custom runtime version

* Update README

* Don't use custom runtime in Ancillary.Interop

Co-authored-by: Santiago Fernandez Madero <[email protected]>

Commit migrated from dotnet/runtimelab@57b11ae
…ng optimization. (dotnet/runtimelab#1063)

* Add support for null arrays in the blittable array marshaller's pinning optimization.

* Add comment block about the behavior.

* Use pointer casting instead of Unsafe.NullRef since we are already using pointers.

Commit migrated from dotnet/runtimelab@c436fda
…otnet/runtimelab#1066)

* Add support for abstract SafeHandle types for by-value marshalling.

* Add test for byref abstract SafeHandle.

* Add abstract by-ref test. Add details for failure case.

Commit migrated from dotnet/runtimelab@a406e64
…-op. I've disabled the test so that we can re-enable it if we end up adding more APIs to the MarshalEx surface. (dotnet/runtimelab#1082)

Commit migrated from dotnet/runtimelab@b7688d5
krwq and others added 17 commits October 19, 2021 08:01
* Added managed implementations for ILogB, removed extern bindings

* Fix bug with managed MathF implementation, removing ILog2 implementation in ecallist and vm

* Add citations to musl implementation.

* Remove whitespace

* Remove Mono bindings

* Add more test cases from musl test library

* Remove native ILogB logic from Mono

* Update citations to official MUSL source
In dotnet#56126 we disabled GDV if the object being boxed came from a call with a
hidden return buffer pointer.

Fix this and enable GDV for these cases by inserting the box allocation statements
before the call.
* Make bounds checks ordinary binary opers

There is no real reason why they cannot be, and making
them enables the deletion of some custom traversal code.

It also enables GTF_REVERSE_OPS, though the diffs from
that appear to be mixed at best. But it did not seem
worth it to quirk anything, as they are also small.

* Fix range check throw block registration

* Disable GTF_REVERSE_OPS for bounds check nodes

To get to zero diffs.

Additionally, the less GTF_REVERSE_OPS we have, the better.

* Revert changes to Early Prop

They are no longer needed now that
GTF_REVERSE_OPS has been disabled.

Note that these changes were CQ-only, i. e. in the
event that some odd code sets GTF_REVERSE_OPS on the
bounds checks nodes, everything will still work correctly.

* Quirk gtFoldExprConst

To get to zero diffs.
Added main Maui build pipeline yml file with target and prop files to properly build Maui for Android with the latest runtime bits, updated the perf.yml file to run the Maui build steps, and piped the Android app artifact through the same line as the AndroidScenario so the perf size on disk tests are run.
* fix rid processing on macOS

* Update src/native/corehost/hostmisc/pal.unix.cpp

* Update src/native/corehost/hostmisc/pal.unix.cpp

* remove extra size calculation
The subset `host.pkg` is not producing the DotNetHost* NuGet packages. This is because the "Pack" target is getting invoked on the pkgprojs, but pkgprojs expect the "Build" target to be called. Since the "Pack" target is overriden in the Directory.Build.targets to be empty, no one is calling the "Build" target on the pkgprojs.

In an official build, a later subset `packs.tests` comes through and builds `Microsoft.DotNet.CoreSetup.Packaging.Tests.csproj`, which explicitly calls "Build" on the pkgprojs. So official builds still get these packages produced.

In source-build, we are no longer building the `packs.tests` subset, so the packages are not produced.
* Update IntelliSense package

* Fixed package version

Co-authored-by: carlossanlop <[email protected]>
…otnet#60599)

* Move 2 Drawing APIs that are not implemented in netfx to netcoreapp3.1 or later (dotnet#60371)

* Don't use ifdefs on ref file
…otnet#58155)

* Replace DisposableFileSystem with FileCleanupTestBase and TestDirectory

* Fix get directory name

Co-authored-by: Jeff Handley <[email protected]>
@pedrobsaila
Copy link
Contributor Author

Sorry for you all, I didn't fix conflict correctly in my branch, I'll close this PR since it tagged so many of you

@ghost ghost locked as resolved and limited conversation to collaborators Nov 19, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
area-System.Security community-contribution Indicates that the PR has been added by a community member
Projects
None yet
Development

Successfully merging this pull request may close these issues.