Skip to content

Fix macOS CI: avoid empty-KeyUsage test cert - #3953

Merged
marcschier merged 1 commit into
master378from
copilot/fix-3944-macos-master378
Jul 4, 2026
Merged

Fix macOS CI: avoid empty-KeyUsage test cert#3953
marcschier merged 1 commit into
master378from
copilot/fix-3944-macos-master378

Conversation

@marcschier

Copy link
Copy Markdown
Collaborator

Summary

Follow-up to #3948 (merged) that fixes a macOS-only CI failure introduced by the issuer/CA KeyUsage tests.

On the macOS Core test job, three tests failed with:

Interop+AppleCrypto+AppleCommonCryptoCryptographicException : Unknown format in import.
   at System.Security.Cryptography.X509Certificates.X509Pal.AppleX509Pal.GetCertContentType(...)
   at System.Security.Cryptography.X509Certificates.X509CertificateLoader.LoadCertificate(...)

The affected tests built a test CA with an empty KeyUsage extension (new X509KeyUsageExtension(X509KeyUsageFlags.None, true) → a zero-bit BIT STRING). Windows (CryptoAPI) and Linux (OpenSSL) load such a certificate, but macOS (AppleCrypto) rejects it as an unknown format. The production code is unaffected — this is purely a test-certificate artifact.

Changes

  • Removed the degenerate empty-KeyUsage test certificate. The truly-absent KeyUsage case (built via CertificateRequest so no KeyUsage extension is emitted) already covers the GetKeyUsage() == None code path.
  • The reject/suppress integration tests now use a present-but-insufficient DigitalSignature KeyUsage (a valid, macOS-loadable certificate that is still missing keyCertSign/cRLSign).

Testing

  • CertificateValidator IssuerKeyUsage tests pass on Windows and Linux (net10.0). The change directly removes the macOS root cause (the empty-KeyUsage extension); all remaining test certificates use standard formats that macOS already loads (the compliant-CA test passed on macOS).

Relates to #3944 · follow-up to #3948

The macOS Core test job failed with AppleCommonCryptoCryptographicException 'Unknown format in import' when loading a certificate built with an empty X509KeyUsageExtension (X509KeyUsageFlags.None -> zero-bit BIT STRING). Drop the degenerate empty-KeyUsage test cert: the truly-absent-KeyUsage case (built via CertificateRequest) already covers the GetKeyUsage()==None path, and the reject/suppress integration tests now use a present-but-insufficient DigitalSignature KeyUsage. Verified on Windows and Linux.
Copilot AI review requested due to automatic review settings July 4, 2026 09:32
@marcschier marcschier added the 1.5.378 Only affects 1.5.378 (pre 2.0) label Jul 4, 2026
@marcschier marcschier changed the title Fix macOS CI: avoid empty-KeyUsage test cert (follow-up to #3948) Fix macOS CI: avoid empty-KeyUsage test cert Jul 4, 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

Note

Copilot couldn't run its full agentic review because no GitHub Actions runner was available. Make sure your repository has a runner available to run Copilot's review, or add a copilot-setup-steps.yml file specifying one with the runs-on attribute. See the docs for more details.

Fixes macOS CI failures in issuer/CA KeyUsage validation tests by avoiding generation of non-standard “empty KeyUsage” test certificates that AppleCrypto refuses to import.

Changes:

  • Removes the test case that creates a CA certificate with a present-but-zero KeyUsage extension.
  • Uses an omitted-KeyUsage CA certificate to cover the GetKeyUsage() == None path without the degenerate encoding.
  • Updates reject/suppress integration tests to use a macOS-loadable but insufficient KeyUsage (DigitalSignature) for the issuer.

@codecov

codecov Bot commented Jul 4, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 60.18%. Comparing base (21eccdd) to head (1c4617e).

Additional details and impacted files

Impacted file tree graph

@@              Coverage Diff              @@
##           master378    #3953      +/-   ##
=============================================
+ Coverage      60.15%   60.18%   +0.02%     
=============================================
  Files            378      378              
  Lines          79082    79082              
  Branches       13840    13840              
=============================================
+ Hits           47574    47595      +21     
+ Misses         27088    27065      -23     
- Partials        4420     4422       +2     

see 11 files with indirect coverage changes

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

@marcschier
marcschier merged commit 33bd8fa into master378 Jul 4, 2026
50 of 53 checks passed
@marcschier
marcschier deleted the copilot/fix-3944-macos-master378 branch July 4, 2026 16:02
GoetzGoerisch pushed a commit to umati/connect that referenced this pull request Aug 4, 2026
…5.378.156 (#24)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [OPCFoundation.NetStandard.Opc.Ua](https://github.com/OPCFoundation/UA-.NETStandard) | `1.5.378.152` → `1.5.378.156` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/OPCFoundation.NetStandard.Opc.Ua/1.5.378.156?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/OPCFoundation.NetStandard.Opc.Ua/1.5.378.152/1.5.378.156?slim=true) |

---

### Release Notes

<details>
<summary>OPCFoundation/UA-.NETStandard (OPCFoundation.NetStandard.Opc.Ua)</summary>

### [`v1.5.378.156`](https://github.com/OPCFoundation/UA-.NETStandard/releases/tag/1.5.378.156): OPC UA 1.05 Maintenance Update

[Compare Source](OPCFoundation/UA-.NETStandard@1.5.378.152...1.5.378.156)

Maintenance Release for fixing bugs found on the main378 development branch.

#### Released packages

[OPCFoundation.NetStandard.Opc.Ua](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Core](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Core/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Security.Certificates](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Security.Certificates/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Configuration](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Configuration/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Server](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Client](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Bindings.Https](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Bindings.Https/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.PubSub](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.PubSub/1.5.378.156)

#### What's Changed

- Fix memory leak: dispose linked CancellationTokenSource in ChannelAsyncOperation.EndAsync by [@&#8203;romanett](https://github.com/romanett) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3812](OPCFoundation/UA-.NETStandard#3812)
- Fix Race condition in OnPublishComplete by [@&#8203;markuswallen](https://github.com/markuswallen) in [#&#8203;3837](OPCFoundation/UA-.NETStandard#3837)
- \[master378] Use request.SessionId instead of request.Session.Id in the ReportAuditCancelEvent call from CancelRequests. by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3853](OPCFoundation/UA-.NETStandard#3853)
- \[Server] Fix NRE in ActivateSession if Session times out before activation completes by [@&#8203;romanett](https://github.com/romanett) in [#&#8203;3844](OPCFoundation/UA-.NETStandard#3844)
- \[Server] Fix [#&#8203;3896](OPCFoundation/UA-.NETStandard#3896): send full certificate chain when CA is in the issuer store (1.5.x) by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3898](OPCFoundation/UA-.NETStandard#3898)
- Synchronize ConditionState branch collection access by [@&#8203;marcschier](https://github.com/marcschier) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3895](OPCFoundation/UA-.NETStandard#3895)
- Fix GDS Push UpdateCertificate ignoring configured SecurityConfiguration policy (master378) by [@&#8203;marcschier](https://github.com/marcschier) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3936](OPCFoundation/UA-.NETStandard#3936)
- Validate issuer/CA certificate KeyUsage (keyCertSign, cRLSign) \[master378 backport] by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3948](OPCFoundation/UA-.NETStandard#3948)
- Fix macOS CI: avoid empty-KeyUsage test cert by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3953](OPCFoundation/UA-.NETStandard#3953)
- Revert "Prune extra decoded children that should stay on the type defnition only. ([#&#8203;3843](OPCFoundation/UA-.NETStandard#3843))" by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3976](OPCFoundation/UA-.NETStandard#3976)
- Prepare 1.5378 maintenance release   by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3982](OPCFoundation/UA-.NETStandard#3982)

**Full Changelog**: <OPCFoundation/UA-.NETStandard@1.5.378.145...1.5.378.156>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTUuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI1NS4yIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://codeberg.org/umati/connect/pulls/24
GoetzGoerisch pushed a commit to umati/connect that referenced this pull request Aug 4, 2026
…r to 1.5.378.156 (#25)

This PR contains the following updates:

| Package | Change | [Age](https://docs.renovatebot.com/merge-confidence/) | [Confidence](https://docs.renovatebot.com/merge-confidence/) |
|---|---|---|---|
| [OPCFoundation.NetStandard.Opc.Ua.Server](https://github.com/OPCFoundation/UA-.NETStandard) | `1.5.378.152` → `1.5.378.156` | ![age](https://developer.mend.io/api/mc/badges/age/nuget/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.156?slim=true) | ![confidence](https://developer.mend.io/api/mc/badges/confidence/nuget/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.152/1.5.378.156?slim=true) |

---

### Release Notes

<details>
<summary>OPCFoundation/UA-.NETStandard (OPCFoundation.NetStandard.Opc.Ua.Server)</summary>

### [`v1.5.378.156`](https://github.com/OPCFoundation/UA-.NETStandard/releases/tag/1.5.378.156): OPC UA 1.05 Maintenance Update

[Compare Source](OPCFoundation/UA-.NETStandard@1.5.378.152...1.5.378.156)

Maintenance Release for fixing bugs found on the main378 development branch.

#### Released packages

[OPCFoundation.NetStandard.Opc.Ua](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Core](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Core/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Security.Certificates](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Security.Certificates/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Configuration](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Configuration/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Server](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Server/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Client](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Client.ComplexTypes/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.Bindings.Https](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.Bindings.Https/1.5.378.156)
[OPCFoundation.NetStandard.Opc.Ua.PubSub](https://www.nuget.org/packages/OPCFoundation.NetStandard.Opc.Ua.PubSub/1.5.378.156)

#### What's Changed

- Fix memory leak: dispose linked CancellationTokenSource in ChannelAsyncOperation.EndAsync by [@&#8203;romanett](https://github.com/romanett) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3812](OPCFoundation/UA-.NETStandard#3812)
- Fix Race condition in OnPublishComplete by [@&#8203;markuswallen](https://github.com/markuswallen) in [#&#8203;3837](OPCFoundation/UA-.NETStandard#3837)
- \[master378] Use request.SessionId instead of request.Session.Id in the ReportAuditCancelEvent call from CancelRequests. by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3853](OPCFoundation/UA-.NETStandard#3853)
- \[Server] Fix NRE in ActivateSession if Session times out before activation completes by [@&#8203;romanett](https://github.com/romanett) in [#&#8203;3844](OPCFoundation/UA-.NETStandard#3844)
- \[Server] Fix [#&#8203;3896](OPCFoundation/UA-.NETStandard#3896): send full certificate chain when CA is in the issuer store (1.5.x) by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3898](OPCFoundation/UA-.NETStandard#3898)
- Synchronize ConditionState branch collection access by [@&#8203;marcschier](https://github.com/marcschier) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3895](OPCFoundation/UA-.NETStandard#3895)
- Fix GDS Push UpdateCertificate ignoring configured SecurityConfiguration policy (master378) by [@&#8203;marcschier](https://github.com/marcschier) with [@&#8203;Copilot](https://github.com/Copilot) in [#&#8203;3936](OPCFoundation/UA-.NETStandard#3936)
- Validate issuer/CA certificate KeyUsage (keyCertSign, cRLSign) \[master378 backport] by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3948](OPCFoundation/UA-.NETStandard#3948)
- Fix macOS CI: avoid empty-KeyUsage test cert by [@&#8203;marcschier](https://github.com/marcschier) in [#&#8203;3953](OPCFoundation/UA-.NETStandard#3953)
- Revert "Prune extra decoded children that should stay on the type defnition only. ([#&#8203;3843](OPCFoundation/UA-.NETStandard#3843))" by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3976](OPCFoundation/UA-.NETStandard#3976)
- Prepare 1.5378 maintenance release   by [@&#8203;mrsuciu](https://github.com/mrsuciu) in [#&#8203;3982](OPCFoundation/UA-.NETStandard#3982)

**Full Changelog**: <OPCFoundation/UA-.NETStandard@1.5.378.145...1.5.378.156>

</details>

---

### Configuration

📅 **Schedule**: (UTC)

- Branch creation
  - Between 12:00 AM and 03:59 AM (`* 0-3 * * *`)
- Automerge
  - At any time (no schedule defined)

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://github.com/renovatebot/renovate).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiI0My4yNTUuMiIsInVwZGF0ZWRJblZlciI6IjQzLjI4Ni4xIiwidGFyZ2V0QnJhbmNoIjoibWFpbiIsImxhYmVscyI6W119-->

Reviewed-on: https://codeberg.org/umati/connect/pulls/25
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)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants