Replace AES checkLicense with MachineFingerprint+LicenseFile+LicenseValidator. License.lic hardcoded next to EXE; -chiave= CLI arg and InputArgs.chiave removed. Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
2.4 KiB
2.4 KiB
| phase | plan | type | status | completed |
|---|---|---|---|---|
| 08-license-integration | 01 | summary | complete | 2026-05-17 |
Phase 08 Summary: license-integration
What Was Built
RSA license check wired into Program.cs. Old AES-based checkLicense deleted. License now validated at startup against license.lic in the EXE directory.
Files modified:
Program.cs— license check replaced,checkLicensedeleted,-chiave=parsing removed,MostraAiutoupdatedInputArgs.cs—chiavefield removed
Acceptance Criteria Results
| AC | Result | Notes |
|---|---|---|
| AC-1: -chiave= arg still parsed | SUPERSEDED | User directed removal mid-APPLY (see Deviations) |
| AC-2: RSA license check at startup | PASS | MachineFingerprint + LicenseFile.TryRead + LicenseValidator.Validate wired |
| AC-3: License failure exits -100 | PASS | Console.WriteLine("Licenza ERRATA") + vediErrore(-100) + return -1 |
| AC-4: Help text updated | PASS | -chiave= block replaced with license.lic location note |
Deviations
Plan AC-1 superseded by user decision.
Plan stated: keep -chiave= as the CLI arg carrying the .lic file path.
User directed mid-APPLY: remove -chiave= entirely; hardcode license.lic next to the EXE.
Actual license path:
string _licPath = Path.Combine(AppDomain.CurrentDomain.BaseDirectory, "license.lic");
inputArgs.chiave field removed from InputArgs.cs. All -chiave= parsing removed from parseArgomenti.
Verification (post-apply grep)
grep "checkLicense|chiave|System.Management|System.Security.Cryptography" Program.cs → 0 hits
grep "MachineFingerprint|LicenseFile|LicenseValidator|NcProgramManager.Licensing" Program.cs → 5 hits
grep "chiave" InputArgs.cs → 0 hits
Decisions Made
- License file always at
AppDomain.CurrentDomain.BaseDirectory + "license.lic"— no CLI override InputArgs.chiavefield deleted (not just unused) — cleaner than leaving dead fieldAesCrypt.csleft on disk (still in csproj, no cleanup in scope)
Deferred Issues
- Real RSA key pair — Phase 09 generates; copy
PublicKeyXmlintoLicenseValidator.cs - Phase 09: separate
LicenseGeneratorconsole app — reads WMI fingerprint, signs, writes.lic AesCrypt.csdead code — remove in future cleanup phase
Tests
No new tests (license core tested in Phase 07). Docker build + 116 tests pass (2 Fanuc FOCAS ignored, Windows-only DLL).