Skip to content

Fix GDS Push UpdateCertificate ignoring configured SecurityConfiguration policy (master378)#3936

Merged
marcschier merged 4 commits into
master378from
copilot/fix-issue-3931-master378
Jul 3, 2026
Merged

Fix GDS Push UpdateCertificate ignoring configured SecurityConfiguration policy (master378)#3936
marcschier merged 4 commits into
master378from
copilot/fix-issue-3931-master378

Conversation

Copilot AI commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Proposed changes

Backport of the #3931 fix to master378. On this branch, server-side GDS Push UpdateCertificate validated the new application certificate with a throwaway CertificateValidator that was never seeded with the server's SecurityConfiguration. It therefore enforced hard-coded defaults (MinimumCertificateKeySize = 2048, RejectSHA1SignedCertificates = true) regardless of operator configuration — e.g. a server configured for a 1024-bit minimum still rejected a re-issued 1024-bit certificate with BadCertificatePolicyCheckFailed. Regression originated in #3795 (integrity check switched from a lenient X509Chain check to the full validator).

The master branch reworked this area entirely, so the fix is re-implemented from scratch here, adapted to master378's X509Certificate2 types.

  • ConfigurationNodeManager.UpdateCertificateAsync: replaced the throwaway CertificateValidator with a lenient X509Chain integrity check that verifies only chain integrity — valid signatures and a complete issuer chain — using the caller-supplied issuers as the trust anchor (AllowUnknownCertificateAuthority, revocation NoCheck, downloads disabled). Policy (min key size, SHA-1, revocation) is intentionally not applied here; it remains governed by the server's SecurityConfiguration on its normal communication channels, so configured values are honored in both stricter and more-lenient directions.

Chain status handling: NoError/UntrustedRoot pass; NotSignatureValid/PartialChain/NotValidForUsage/InvalidBasicConstraints fail with BadSecurityChecksFailed; and the chain element count must match the supplied issuer count to reject incomplete chains.

Related Issues

Types of changes

What types of changes does your code introduce?
Put an x in the boxes that apply. You can also fill these out after creating the PR.

  • 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

Put an x in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.

  • 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

The lenient X509Chain approach mirrors the master-branch fix and restores pre-#3795 behavior: UpdateCertificate verifies only the integrity of the supplied cert + issuer chain, leaving acceptance policy to the server's configuration. Existing UpdateCertificateCASigned push tests (RSA + ECC NIST/Brainpool) pass; both review gates (net10.0, net48) build with 0 warnings. Explicit coverage for the non-default-key-size scenario is not added here — worth considering if maintainers want a regression guard.

@CLAassistant

Copy link
Copy Markdown

CLA assistant check
Thank you for your submission! We really appreciate it. Like many open source projects, we ask that you sign our Contributor License Agreement before we can accept your contribution.
You have signed the CLA already but the status is still pending? Let us recheck it.

Copilot AI linked an issue Jul 1, 2026 that may be closed by this pull request
5 tasks
Copilot AI changed the title [WIP] Fix issue #3931 in master378 branch Fix GDS Push UpdateCertificate ignoring configured SecurityConfiguration policy (master378) Jul 1, 2026
Copilot AI requested a review from marcschier July 1, 2026 16:09
@marcschier
marcschier marked this pull request as ready for review July 1, 2026 16:48
Copilot AI review requested due to automatic review settings July 1, 2026 16:48
@marcschier marcschier added the 1.5.378 Only affects 1.5.378 (pre 2.0) label Jul 1, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Pull request overview

This PR backports the fix from #3931 to master378 by changing how server-side GDS Push UpdateCertificate validates an incoming CA-signed application certificate, so it no longer (incorrectly) applies hard-coded CertificateValidator policy defaults instead of honoring operator configuration.

Changes:

  • Replaces the throwaway CertificateValidator validation with a lenient X509Chain build to verify issuer-chain integrity from the caller-supplied issuer set.
  • Disables revocation checks/downloads in the chain policy to avoid network dependence during push validation.

Comment thread Libraries/Opc.Ua.Server/Configuration/ConfigurationNodeManager.cs Outdated
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 66.66667% with 2 lines in your changes missing coverage. Please review.
✅ Project coverage is 60.13%. Comparing base (5924fe6) to head (d2d44d7).

Files with missing lines Patch % Lines
...a.Server/Configuration/ConfigurationNodeManager.cs 66.66% 2 Missing ⚠️
Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           master378    #3936      +/-   ##
=============================================
+ Coverage      60.10%   60.13%   +0.02%     
=============================================
  Files            378      378              
  Lines          79063    79069       +6     
  Branches       13838    13838              
=============================================
+ Hits           47521    47548      +27     
+ Misses         27120    27107      -13     
+ Partials        4422     4414       -8     
Files with missing lines Coverage Δ
...a.Server/Configuration/ConfigurationNodeManager.cs 75.14% <66.66%> (-0.08%) ⬇️

... and 10 files with indirect coverage changes

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@romanett romanett left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Imo this fix is too verbose why not seed a new certificate validation from the Security configuration?

@marcschier

Copy link
Copy Markdown
Collaborator

Imo this fix is too verbose why not seed a new certificate validation from the Security configuration?

@copilot please address

Copilot AI commented Jul 2, 2026

Copy link
Copy Markdown
Contributor Author

Imo this fix is too verbose why not seed a new certificate validation from the Security configuration?

@copilot please address

Done in d2d44d7. Replaced the verbose X509Chain block with a CertificateValidator seeded from the server's SecurityConfiguration (via UpdateAsync), then trusting the caller-supplied issuer chain as the trust anchor. Configured policy (minimum key size, SHA-1, revocation) is now honored directly by the validator instead of being hard-coded. GDS Push UpdateCertificate tests pass (36 passed, 4 ECC-on-framework skipped); net10.0 and net48 build with 0 warnings.

@marcschier marcschier added the ready Ready to merge once CI Passes label Jul 2, 2026
@marcschier
marcschier merged commit 6a304ef into master378 Jul 3, 2026
89 of 92 checks passed
@marcschier
marcschier deleted the copilot/fix-issue-3931-master378 branch July 3, 2026 09:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

1.5.378 Only affects 1.5.378 (pre 2.0) ready Ready to merge once CI Passes

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Fix #3931 also in master378

5 participants