Harden SDK compatibility and lifecycle reliability#132
Conversation
There was a problem hiding this comment.
Code Review
This pull request introduces several robustness improvements, bug fixes, and compatibility updates to align with the current WireSock SDK. Key changes include accepting UTF-8 BOM configurations, ignoring empty comma-separated items in routing lists, preventing exceptions on malformed IP inputs, dynamically resizing buffers for long process image paths, and improving resource loading safety. Additionally, it fixes cancellation token disposal in TaskManager, ensures native cleanup runs in frmMain, and bounds directory traversals to include subdirectories when enforcing catalog limits. No review comments were provided, so there is no additional feedback to assess.
Important
The consumer version of Gemini Code Assist on GitHub is being sunset. Starting June 18, 2026, new organization installations will be blocked, and all code review activity will officially cease on July 17, 2026.
For more details on the timeline and next steps, please review the Help Documentation.
There was a problem hiding this comment.
Pull request overview
This PR hardens WireSockUI’s compatibility with the current WireSock SDK contract and improves reliability around lifecycle cleanup, profile directory bounding, validation behavior, and native interop robustness.
Changes:
- Updated config parsing/validation to match SDK behavior (accept UTF-8 BOM; ignore blank routing-list tokens; stricter CIDR prefix parsing; reject malformed inputs safely).
- Hardened reliability/interop paths (timed-out cleanup finalization, cancellation ownership, X25519 all-zero shared-secret rejection, long process-image path lookup, safer Windows icon DLL loading).
- Added/updated targeted regressions, documentation, and bumped the pinned SDK revision snapshot.
Reviewed changes
Copilot reviewed 12 out of 12 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| WireSockUI/Native/WireguardConfigParser.cs | Accept UTF-8 BOM while still rejecting incompatible BOMs/encodings. |
| WireSockUI/Native/WindowsIcons.cs | Load icon resources via LoadLibraryEx as resource-only, add bounds checks. |
| WireSockUI/Native/ProcessList.cs | Grow QueryFullProcessImageName buffers for long paths; make class static. |
| WireSockUI/Native/IPHelper.cs | Reject null/whitespace safely; strict decimal CIDR prefix parsing. |
| WireSockUI/Forms/TaskManager.cs | Adjust refresh cancellation ownership/disposal to reduce races. |
| WireSockUI/Forms/frmMain.cs | Ensure native cleanup finalization even on failure paths. |
| WireSockUI/Config/ProfileFileTransaction.cs | Bound scans by counting all directory entries; enumerate files safely. |
| WireSockUI/Config/Profile.cs | Ignore blank route tokens for specific keys; count all directory entries in catalog. |
| WireSockUI/Config/Curve25519.cs | Reject all-zero X25519 shared secrets from low-order peer keys. |
| WireSockUI.Tests/Program.cs | Add regressions for BOM handling, blank routing tokens, CIDR validation, bounded recovery, X25519 all-zero secret. |
| sdk-contract/SDK_REVISION | Update pinned SDK revision hash. |
| README.md | Document UTF-8 BOM acceptance, blank routing token behavior, and bounded directory entry semantics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Summary
wgbooster.dllprofile handling with the latest WireSock SDK parser, including UTF-8 BOMs, blank routing-list tokens, strict CIDR prefixes, and the current pinned SDK revisionProduction-readiness findings addressed
falsefor null input instead of throwingThe elevated direct-DLL architecture remains unchanged; this does not introduce or depend on the modern service.
Verification
WireSockUI.Testssuite passed repeatedly; one pre-existing symbolic-link test was skipped because link creation is unavailable in this environmentdotnet format ... --verify-no-changespassedRelease/Release UWPxAnyCPU/x64/ARM64a5183451c62b42abe0a5fb67be215bb5a9375603origin/main; no merge conflict or stale-base deltaMigration and remaining risk
Address,AllowedIPs, andDisallowedIPsare ignored like the SDK; malformed nonblank items still fail closedwiresock-sdkCI runners