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 X509CertificateStore support CRLs on Windows #2571

Open
wants to merge 13 commits into
base: master
Choose a base branch
from

Conversation

romanett
Copy link
Contributor

Proposed changes

This PR extends the existing X509 CertificateStore building on top of the .NET X509Store Class to support Certificate Revocation Lists (CRLs) This is important to make the X509Store viable for use as Trust and Issuer Store.

Considerations:

  • only Works on Windows, on all other OS the "SupportsCRLs"-Property of the Store still returns false
  • builds on top of the Win32 API
  • uses source generated P-Invoke calls to call into Win32 API (https://github.com/microsoft/CsWin32)
  • makes use of Extension Methods of .NET X509Store Class to make the CRL Enumerate / Add / Delete accessible for the Store Implementation
  • guards ever call with OS Support calls and throws PlatformNotSupportedException
  • Behaviour of the X509CertificateStore for Linux/MacOS is unchanged
  • Added unit tests for the Certificate Store testing all relvant implemented crl functions
  • Extended GDS Tests for Integration Testing by utilizing Client & Server making second run on windows with only X509 Stores

Related Issues

Types of changes

  • Bugfix (non-breaking change which fixes an issue)
  • Enhancement (non-breaking change which adds functionality)
  • Test enhancement (non-breaking change to increase test coverage)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected, requires version increase of Nuget packages)
  • Documentation Update (if none of the other choices apply)

Checklist

  • I have read the CONTRIBUTING doc.
  • I have signed the CLA.
  • I ran tests locally with my changes, all passed.
  • I fixed all failing tests in the CI pipelines.
  • I fixed all introduced issues with CodeQL and LGTM.
  • I have added tests that prove my fix is effective or that my feature works and increased code coverage.
  • I have added necessary documentation (if appropriate).
  • Any dependent changes have been merged and published in downstream modules.

Further comments

Documentation still a ToDo

@romanett romanett self-assigned this Mar 31, 2024
Copy link

codecov bot commented Mar 31, 2024

Codecov Report

Attention: Patch coverage is 59.53757% with 70 lines in your changes are missing coverage. Please review.

Project coverage is 54.69%. Comparing base (60689c9) to head (8272d0d).

Files Patch % Lines
...tificateStore/Extensions/Internal/X509CrlHelper.cs 52.94% 26 Missing and 6 partials ⚠️
...cates/X509CertificateStore/X509CertificateStore.cs 69.69% 8 Missing and 12 partials ⚠️
...CertificateStore/Extensions/X509StoreExtensions.cs 47.61% 4 Missing and 7 partials ⚠️
...tificateStore/Extensions/Internal/PInvokeHelper.cs 33.33% 6 Missing ⚠️
.../X509CertificateStore/Extensions/PlatformHelper.cs 88.88% 0 Missing and 1 partial ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #2571      +/-   ##
==========================================
+ Coverage   54.62%   54.69%   +0.06%     
==========================================
  Files         342      346       +4     
  Lines       65082    65253     +171     
  Branches    13350    13403      +53     
==========================================
+ Hits        35553    35688     +135     
- Misses      25661    25674      +13     
- Partials     3868     3891      +23     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

@mregen mregen added this to the April Update milestone Apr 3, 2024
@mregen
Copy link
Contributor

mregen commented Apr 3, 2024

test comment

Copy link
Contributor

@mregen mregen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

we need to check for the unsafe code and the implications.

Stack/Opc.Ua.Core/Opc.Ua.Core.csproj Show resolved Hide resolved
@mregen
Copy link
Contributor

mregen commented Apr 22, 2024

@romanett please resolve conflict

Copy link
Contributor

@mregen mregen left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

More changes than I thought, will continue the code review next week.
Also give @ThomasNehring an opportunity to share feedback.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants