diff --git a/.github/actions/setup-certum/action.yml b/.github/actions/setup-certum/action.yml index e1aca2546..615e210c7 100644 --- a/.github/actions/setup-certum/action.yml +++ b/.github/actions/setup-certum/action.yml @@ -20,23 +20,24 @@ runs: CERTUM_OTP_URI: ${{ inputs.otp-uri }} CERTUM_KEY_ID: ${{ inputs.thumbprint }} run: node "${{ github.action_path }}/../../../scripts/validate-certum-configuration.mjs" - - name: Verify SimplySign installer + - name: Install verified SimplySign client shell: pwsh + run: '& "${{ github.action_path }}/../../../scripts/certum/Install-SimplySign.ps1"' + - name: Authenticate cloud certificate + shell: pwsh + env: + CERTUM_USERNAME: ${{ inputs.username }} + CERTUM_OTP_URI: ${{ inputs.otp-uri }} + CERTUM_KEY_ID: ${{ inputs.thumbprint }} + CAPTURE_DIAGNOSTICS: 'false' + run: '& "${{ github.action_path }}/../../../scripts/certum/Connect-SimplySign.ps1"' + - name: Verify expected signing certificate + shell: pwsh + env: + CERTUM_KEY_ID: ${{ inputs.thumbprint }} run: | - $ErrorActionPreference = 'Stop' - Invoke-WebRequest 'https://files.certum.eu/software/SimplySignDesktop/Windows/9.4.3.90/SimplySignDesktop-9.4.3.90-64-bit-en.msi' -OutFile SimplySignDesktop.msi - $hash = (Get-FileHash -Algorithm SHA256 SimplySignDesktop.msi).Hash - if ($hash -ne 'CE2B38EF0124A574BC08E5558726099CAAC79A7C58B8D3D712F629371FE1BCB7') { - throw 'SimplySign installer SHA-256 does not match the pinned 9.4.3.90 build' + $certificate = @(Get-ChildItem Cert:\CurrentUser\My | Where-Object { $_.Thumbprint -eq $env:CERTUM_KEY_ID -and $_.EnhancedKeyUsageList -like '*Code Signing*' }) + if ($certificate.Count -ne 1 -or $certificate[0].NotAfter -le (Get-Date) -or $certificate[0].NotBefore -gt (Get-Date)) { + throw 'Expected current Certum code-signing certificate is unavailable.' } - $signature = Get-AuthenticodeSignature SimplySignDesktop.msi - if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch 'Asseco Data Systems') { - throw 'SimplySign installer signature or publisher verification failed' - } - - name: Authenticate cloud certificate - uses: dismine/windows-app-signing-setup-action@89ae3b032d4bc7a5b98d1a42a34e61ecb6faad64 - with: - certum-username: ${{ inputs.username }} - certum-otp-uri: ${{ inputs.otp-uri }} - certum-key-id: ${{ inputs.thumbprint }} - capture-diagnostics: 'false' + Write-Host 'Expected Certum code-signing certificate is available; actual signatures must still pass trust and timestamp verification.' diff --git a/.github/release-signing.yml b/.github/release-signing.yml index eba45defb..1e910a346 100644 --- a/.github/release-signing.yml +++ b/.github/release-signing.yml @@ -17,6 +17,9 @@ fingerprint_files: - .github/actions/setup-certum/action.yml - scripts/sign-certum.ps1 - scripts/validate-certum-configuration.mjs + - scripts/certum/Install-SimplySign.ps1 + - scripts/certum/Connect-SimplySign.ps1 + - scripts/certum-login-ui.ps1 - scripts/install-nsis.ps1 - .github/workflows/release-candidate.yml - .github/workflows/release-promote.yml diff --git a/.github/workflows/certum-signing-smoke.yml b/.github/workflows/certum-signing-smoke.yml index 9b06cb6d1..9a7c0e1ee 100644 --- a/.github/workflows/certum-signing-smoke.yml +++ b/.github/workflows/certum-signing-smoke.yml @@ -2,6 +2,11 @@ name: Certum signing smoke test on: workflow_dispatch: + inputs: + client_probe_only: + description: Inspect the pinned client's login controls without credentials or signing + type: boolean + default: false permissions: contents: read @@ -11,8 +16,27 @@ concurrency: cancel-in-progress: false jobs: + client-probe: + if: github.repository == 'SivanCola/deepzora' && inputs.client_probe_only + runs-on: windows-2022 + timeout-minutes: 10 + steps: + - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7 + with: + ref: ${{ github.workflow_sha }} + persist-credentials: false + - name: Probe official client control roles without credentials + shell: pwsh + run: ./scripts/certum-client-probe.ps1 + - name: Save empty client UI on probe failure + if: failure() + uses: actions/upload-artifact@cf430e030ddbb5b0abf93d22962f4752f3646cd9 + with: + name: certum-credential-free-probe + path: simplysign-diag-*-credential-free-probe.png + retention-days: 1 sign: - if: github.repository == 'SivanCola/deepzora' && github.ref == 'refs/heads/main' && github.ref_protected + if: github.repository == 'SivanCola/deepzora' && github.ref == 'refs/heads/main' && github.ref_protected && !inputs.client_probe_only runs-on: windows-2022 environment: release timeout-minutes: 20 diff --git a/LICENSING.md b/LICENSING.md index 7adb5c7ff..1769e7f6d 100644 --- a/LICENSING.md +++ b/LICENSING.md @@ -42,12 +42,19 @@ Explicit component licenses remain in effect, including: merely because it renders or generates themes. - Dependencies and bundled runtimes under their respective licenses; their notices must be retained when required. +- The SimplySign authentication script derived from + `dismine/windows-app-signing-setup-action` at commit + `89ae3b032d4bc7a5b98d1a42a34e61ecb6faad64`; its MIT notice is preserved in + [scripts/certum/UPSTREAM-LICENSE](scripts/certum/UPSTREAM-LICENSE). 各组件明确声明的许可继续有效,包括 Harness 上游 MIT 声明、供应商和 Seti 图标 许可、明确标注 MIT 的官方主题素材与主题包数据,以及依赖和运行时各自的协议。 主题素材例外不延伸到仅因渲染或生成主题而相关的应用代码。分发时须保留适用的 第三方声明;本清单不替代逐次发布的依赖与许可核查。 +SimplySign 认证脚本源自 `dismine/windows-app-signing-setup-action` 的上述固定提交, +其 MIT 版权与许可原文保留在 [UPSTREAM-LICENSE](scripts/certum/UPSTREAM-LICENSE)。 + ## Distribution and network use / 分发与网络使用 Commercial use, paid redistribution and independent forks are allowed subject diff --git a/cmd/release-signing-contract/certum_ui_test.go b/cmd/release-signing-contract/certum_ui_test.go new file mode 100644 index 000000000..4619ec42d --- /dev/null +++ b/cmd/release-signing-contract/certum_ui_test.go @@ -0,0 +1,53 @@ +package main + +import ( + "os" + "os/exec" + "path/filepath" + "runtime" + "testing" +) + +func TestPowerShellCertumWindowReadiness(t *testing.T) { + script, err := filepath.Abs("../../scripts/certum-login-ui.test.ps1") + if err != nil { + t.Fatal(err) + } + found := false + for _, name := range []string{"pwsh", "powershell.exe"} { + binary, err := exec.LookPath(name) + if err != nil { + continue + } + found = true + t.Run(name, func(t *testing.T) { + command := exec.Command(binary, "-NoLogo", "-NoProfile", "-NonInteractive", "-File", script) + if output, err := command.CombinedOutput(); err != nil { + t.Fatalf("Certum UI regression: %v\n%s", err, output) + } + }) + } + if !found { + t.Skip("PowerShell is unavailable; Windows CI runs both PowerShell runtimes") + } +} + +func TestCertumOfficialClientReadiness(t *testing.T) { + if runtime.GOOS != "windows" || os.Getenv("GITHUB_ACTIONS") != "true" || os.Getenv("RUNNER_ENVIRONMENT") != "github-hosted" { + t.Skip("Official client probe requires a disposable GitHub-hosted Windows runner") + } + binary, err := exec.LookPath("pwsh") + if err != nil { + t.Fatal(err) + } + root, err := filepath.Abs("../..") + if err != nil { + t.Fatal(err) + } + // The probe has no signing credentials and never submits a login. It checks + // that the official pinned client exposes the control roles our wait needs. + command := exec.Command(binary, "-NoLogo", "-NoProfile", "-NonInteractive", "-File", filepath.Join(root, "scripts/certum-client-probe.ps1")) + if output, err := command.CombinedOutput(); err != nil { + t.Fatalf("Official SimplySign form probe: %v\n%s", err, output) + } +} diff --git a/docs/CERTUM_SIGNING.md b/docs/CERTUM_SIGNING.md index 8253033d0..c2c555d76 100644 --- a/docs/CERTUM_SIGNING.md +++ b/docs/CERTUM_SIGNING.md @@ -37,14 +37,22 @@ TOTP 密钥。 The smoke workflow checks credential format before compiling probes. The shared login action checks it again, pins the SimplySign installer SHA-256 as well as -its publisher signature, and keeps authentication screenshots disabled. Both -signing workflows disconnect the cloud session even when signing fails. Format +its publisher signature, and keeps authentication screenshots disabled. The +owned login adapter waits for two editable controls and an OK button, rather +than treating the first visible splash window as the login form. It ignores +background windows when identifying acknowledgement dialogs. A credential-free +probe of the official client runs only on disposable GitHub-hosted Windows +runners; deterministic tests reproduce the splash/disappearance/form ordering. +Both signing workflows disconnect the cloud session even when signing fails. Format validation does not prove that the account, certificate or TOTP seed is valid; only a successful live signing test does. 签名测试在编译探针前检查凭据格式;共享登录 Action 再次检查,并同时验证 SimplySign -安装器的固定 SHA-256 和发布者签名,保持登录截图关闭。两个签名工作流在签名失败时 -也会断开云签名会话。格式检查不能证明账号、证书或 TOTP 密钥有效,仍须实际签名成功。 +安装器的固定 SHA-256 和发布者签名,保持登录截图关闭。仓库维护的登录适配器等待两个 +可编辑控件和 OK 按钮出现,不把最先出现的启动窗口当作登录表单,识别确认弹窗时也会 +排除后台窗口。官方客户端的无凭据探测只在可丢弃的 GitHub 托管 Windows runner 上 +运行;确定性测试覆盖“启动窗出现、消失、登录表单出现”的顺序。两个签名工作流在 +签名失败时也会断开云签名会话。格式检查不能证明账号、证书或 TOTP 密钥有效,仍须实际签名成功。 Historical Stable versions `0.0.1`–`0.0.6` retain their explicit unsigned policy. Unlisted versions such as `0.0.7` require Certum automatically and cannot fall @@ -59,13 +67,15 @@ a new signed candidate rather than silently replacing an existing release. Run **Certum signing smoke test** on protected `main`, approve the `release` environment, and require successful login, signing, trust, signer and timestamp -verification. This test publishes nothing. The third-party login action is -pinned to an audited commit; authentication screenshots are disabled. Review -upstream code before updating the pin. +verification. This test publishes nothing. The authentication implementation is +vendored from an audited upstream commit with its MIT notice; the local window +readiness adapter is covered by regression tests. Authentication screenshots +are disabled. Review upstream changes before updating the vendored code. 先在 `main` 手动运行签名测试并批准 `release` 环境。测试不发布产物,必须通过 -登录、实际签名、信任链、签名者及时间戳检查。第三方登录 Action 固定提交,更新前 -需要审查,登录截图默认关闭。 +登录、实际签名、信任链、签名者及时间戳检查。认证实现从已审查的上游固定提交引入 +仓库并保留 MIT 声明,本地窗口就绪适配器有回归测试。更新上游代码前需要审查,登录 +截图保持关闭。 Release builds retain native x64 and ARM64 startup tests. Their exact payloads and generated NSIS identity files pass through same-run artifacts to serialized diff --git a/scripts/certum-client-probe.ps1 b/scripts/certum-client-probe.ps1 new file mode 100644 index 000000000..2fb6d29e9 --- /dev/null +++ b/scripts/certum-client-probe.ps1 @@ -0,0 +1,16 @@ +$ErrorActionPreference = 'Stop' +if ($env:GITHUB_ACTIONS -ne 'true' -or $env:RUNNER_ENVIRONMENT -ne 'github-hosted') { + throw 'The credential-free SimplySign UI probe requires a disposable GitHub-hosted runner.' +} +foreach ($name in @('CERTUM_USERNAME', 'CERTUM_OTP_URI', 'CERTUM_KEY_ID')) { + [Environment]::SetEnvironmentVariable($name, $null, 'Process') +} +# This disposable probe has no credentials and never submits a login. Capture +# its empty UI on failure only; normal authentication keeps captures disabled. +$env:CAPTURE_DIAGNOSTICS = 'true' +try { + & (Join-Path $PSScriptRoot 'certum/Install-SimplySign.ps1') -InstallerPath (Join-Path $env:RUNNER_TEMP 'SimplySign-probe.msi') + & (Join-Path $PSScriptRoot 'certum/Connect-SimplySign.ps1') -ProbeOnly +} finally { + Get-Process -Name '*SimplySign*' -ErrorAction SilentlyContinue | Stop-Process -Force +} diff --git a/scripts/certum-login-ui.ps1 b/scripts/certum-login-ui.ps1 new file mode 100644 index 000000000..bc151838a --- /dev/null +++ b/scripts/certum-login-ui.ps1 @@ -0,0 +1,96 @@ +# Read only control roles; never read field values or capture authentication UI. +function Get-CertumWindowObservation { + param([IntPtr]$Handle) + if (-not ('CertumControlRoles' -as [type])) { + Add-Type -TypeDefinition @' +using System; +using System.Collections.Generic; +using System.Runtime.InteropServices; +using System.Text; +public static class CertumControlRoles { + public sealed class Control { public IntPtr Handle; public string ClassName; public string ButtonName; } + private delegate bool EnumProc(IntPtr handle, IntPtr parameter); + [DllImport("user32.dll")] private static extern bool EnumChildWindows(IntPtr parent, EnumProc callback, IntPtr parameter); + [DllImport("user32.dll", CharSet=CharSet.Unicode)] private static extern int GetClassName(IntPtr handle, StringBuilder text, int count); + [DllImport("user32.dll", CharSet=CharSet.Unicode)] private static extern int GetWindowText(IntPtr handle, StringBuilder text, int count); + public static Control[] Read(IntPtr parent) { + var controls = new List(); + EnumChildWindows(parent, (handle, parameter) => { + var name = new StringBuilder(256); + GetClassName(handle, name, name.Capacity); + var control = new Control { Handle = handle, ClassName = name.ToString() }; + // Never read edit text. Only acknowledgement button labels matter. + if (control.ClassName == "Button" || control.ClassName.StartsWith("WindowsForms10.BUTTON.")) { + var label = new StringBuilder(128); + GetWindowText(handle, label, label.Capacity); + control.ButtonName = label.ToString(); + } + controls.Add(control); + return true; + }, IntPtr.Zero); + return controls.ToArray(); + } +} +'@ + } + try { + $controls = @([CertumControlRoles]::Read($Handle)) + $edits = @($controls | Where-Object { $_.ClassName -eq 'Edit' -or $_.ClassName -like 'WindowsForms10.EDIT.*' }) + $names = @($controls | Where-Object { $_.ClassName -eq 'Button' -or $_.ClassName -like 'WindowsForms10.BUTTON.*' } | ForEach-Object { ($_.ButtonName -replace '&', '').Trim() } | + Where-Object { $_ -in @('OK', 'No', 'Cancel') }) + return [pscustomobject]@{ Handle = $Handle; EditCount = $edits.Count; Buttons = $names; Classes = @($controls.ClassName | Sort-Object -Unique) } + } catch { + # A window may disappear while Qt constructs or replaces its controls. + return $null + } +} + +function Select-CertumLoginWindow { + param([object[]]$Observations) + $forms = @($Observations | Where-Object { $null -ne $_ -and $_.EditCount -eq 2 -and $_.Buttons -contains 'OK' }) + if ($forms.Count -gt 1) { throw 'Multiple SimplySign credential forms; refusing ambiguous input.' } + if ($forms.Count -eq 1) { return [IntPtr]$forms[0].Handle } + return [IntPtr]::Zero +} + +function Wait-CertumLoginWindow { + param( + [scriptblock]$EnumerateWindows = { Get-SimplySignWindows }, + [scriptblock]$ObserveWindow = { param($handle) Get-CertumWindowObservation -Handle $handle }, + [scriptblock]$StillRunning = { $proc.Refresh(); -not $proc.HasExited }, + [int]$MaxPolls = 120, + [int]$PollMilliseconds = 250 + ) + $lastShape = $null + for ($poll = 0; $poll -lt $MaxPolls; $poll++) { + if (-not (& $StillRunning)) { throw 'SimplySign exited before its credential form was ready.' } + $observations = @(& $EnumerateWindows | ForEach-Object { & $ObserveWindow $_ }) + $shape = (@($observations | Where-Object { $null -ne $_ } | ForEach-Object { + "handle=$($_.Handle) edits=$($_.EditCount) acknowledgementButtons=$($_.Buttons.Count) classes=$($_.Classes -join ',')" + }) -join '; ') + if ($shape -ne $lastShape) { + Write-Host "SimplySign control roles: $shape" + $lastShape = $shape + } + $handle = Select-CertumLoginWindow -Observations $observations + if ($handle -ne [IntPtr]::Zero) { + Write-Host 'SimplySign credential form is ready (two edit controls and OK); splash windows were ignored.' + return $handle + } + if ($PollMilliseconds -gt 0) { Start-Sleep -Milliseconds $PollMilliseconds } + } + throw 'SimplySign did not expose an unambiguous credential form; no credentials were submitted.' +} + +function Get-CertumPopupWindows { + param([IntPtr]$LoginHandle) + foreach ($handle in @(Get-SimplySignWindows)) { + if ([IntPtr]$handle -eq $LoginHandle) { continue } + $observation = Get-CertumWindowObservation -Handle $handle + # Background/splash windows are not acknowledgement dialogs. In + # particular, never press Enter into a second credential form. + if ($null -ne $observation -and $observation.EditCount -eq 0 -and $observation.Buttons.Count -gt 0) { + $handle + } + } +} diff --git a/scripts/certum-login-ui.test.ps1 b/scripts/certum-login-ui.test.ps1 new file mode 100644 index 000000000..18d7e8bd4 --- /dev/null +++ b/scripts/certum-login-ui.test.ps1 @@ -0,0 +1,46 @@ +$ErrorActionPreference = 'Stop' +. (Join-Path $PSScriptRoot 'certum-login-ui.ps1') +function Assert-Equal($actual, $expected, $message) { + if ($actual -ne $expected) { throw $message } +} +function Assert-Rejected([scriptblock]$action) { + $rejected = $false + try { & $action | Out-Null } catch { $rejected = $true } + if (-not $rejected) { throw 'Expected fail-closed rejection.' } +} +$splash = [pscustomobject]@{ Handle = 1; EditCount = 0; Buttons = @() } +$login = [pscustomobject]@{ Handle = 2; EditCount = 2; Buttons = @('OK', 'Cancel') } +$update = [pscustomobject]@{ Handle = 3; EditCount = 0; Buttons = @('No') } +Assert-Equal (Select-CertumLoginWindow @($splash)) ([IntPtr]::Zero) 'A splash screen was mistaken for a login form.' +Assert-Equal (Select-CertumLoginWindow @($splash, $update, $login)) ([IntPtr]2) 'Control roles did not select the login form.' +Assert-Rejected { Select-CertumLoginWindow @($login, $login) } + +# Reproduce the recorded ordering: a splash exists first, it disappears, and +# only then does the actual credential form become visible. +$script:poll = 0 +$handle = Wait-CertumLoginWindow -EnumerateWindows { + $script:poll++ + if ($script:poll -eq 1) { 1 } + if ($script:poll -eq 3) { 1; 2; 3 } +} -ObserveWindow { + param($value) + if ($value -eq 1) { $splash } + if ($value -eq 2) { $login } + if ($value -eq 3) { $update } +} -StillRunning { $true } -MaxPolls 3 -PollMilliseconds 0 +Assert-Equal $handle ([IntPtr]2) 'Readiness returned before credential controls existed.' +Assert-Equal $script:poll 3 'The transient splash window ended the wait early.' +Assert-Rejected { Wait-CertumLoginWindow -EnumerateWindows { 1 } -ObserveWindow { $splash } -StillRunning { $true } -MaxPolls 2 -PollMilliseconds 0 } +Assert-Rejected { Wait-CertumLoginWindow -StillRunning { $false } -PollMilliseconds 0 } + +function Get-SimplySignWindows { 1; 2; 3; 4 } +function Get-CertumWindowObservation($Handle) { + if ($Handle -eq 1) { return $splash } + if ($Handle -eq 2) { return $login } + if ($Handle -eq 3) { return $update } + return [pscustomobject]@{ Handle = 4; EditCount = 2; Buttons = @('OK') } +} +$popups = @(Get-CertumPopupWindows -LoginHandle 2) +Assert-Equal $popups.Count 1 'Splash or credential windows were treated as popups.' +Assert-Equal $popups[0] ([IntPtr]3) 'The acknowledgement dialog was not selected.' +Write-Host 'Certum credential form readiness and popup isolation: PASS' diff --git a/scripts/certum/Connect-SimplySign.ps1 b/scripts/certum/Connect-SimplySign.ps1 new file mode 100644 index 000000000..42431e359 --- /dev/null +++ b/scripts/certum/Connect-SimplySign.ps1 @@ -0,0 +1,622 @@ +# Derived from dismine/windows-app-signing-setup-action at +# 89ae3b032d4bc7a5b98d1a42a34e61ecb6faad64 (MIT; see UPSTREAM-LICENSE). +# Local changes bind readiness and popup handling to UI control roles. +# Connect-SimplySign-Enhanced.ps1 +# Registry-Enhanced TOTP Authentication for SimplySign Desktop +# Uses registry pre-configuration + TOTP credential injection approach +# Based on Devas.life article: https://www.devas.life/how-to-automate-signing-your-windows-app-with-certum/ + +param( + [string]$OtpUri = $env:CERTUM_OTP_URI, + [string]$UserId = $env:CERTUM_USERNAME, + [string]$KeyId = $env:CERTUM_KEY_ID, + [string]$InstallPath = $env:SS_PATH, + [switch]$ProbeOnly +) + +# Validate required parameters +if (-not $ProbeOnly -and -not $OtpUri) { + Write-Host "ERROR: CERTUM_OTP_URI environment variable not provided" + exit 1 +} + +if (-not $ProbeOnly -and -not $UserId) { + Write-Host "ERROR: CERTUM_USERNAME environment variable not provided" + exit 1 +} + +# Resolve full exe path +$ExePath = "$InstallPath\SimplySignDesktop.exe" +if (-not (Test-Path $ExePath)) { + $ExePath = "$env:ProgramFiles\Certum\SimplySign Desktop\SimplySignDesktop.exe" +} + +Write-Host "=== REGISTRY-ENHANCED TOTP AUTHENTICATION ===" +Write-Host "Using registry pre-configuration + credential injection" +Write-Host "OTP URI provided (length: $($OtpUri.Length))" +Write-Host "User ID: $UserId" +Write-Host "Executable: $ExePath" +Write-Host "" + +# Verify SimplySign Desktop exists +if (-not (Test-Path $ExePath)) { + Write-Host "ERROR: SimplySign Desktop not found at: $ExePath" + exit 1 +} + +# Parse the otpauth:// URI +if (-not $ProbeOnly) { + $uri = [Uri]$OtpUri + + # Parse query parameters (compatible with both PowerShell 5.1 and 7+) + try { + Add-Type -AssemblyName System.Web -ErrorAction Stop + $q = [System.Web.HttpUtility]::ParseQueryString($uri.Query) + } catch { + $q = @{} + foreach ($part in $uri.Query.TrimStart('?') -split '&') { + $kv = $part -split '=', 2 + if ($kv.Count -eq 2) { + $q[$kv[0]] = [Uri]::UnescapeDataString($kv[1]) + } + } + } + + $Base32 = $q['secret'] + $Digits = if ($q['digits']) { [int]$q['digits'] } else { 6 } + $Period = if ($q['period']) { [int]$q['period'] } else { 30 } + $Algorithm = if ($q['algorithm']) { $q['algorithm'].ToUpper() } else { 'SHA256' } + + # Validate supported algorithms + $SupportedAlgorithms = @('SHA1', 'SHA256', 'SHA512') + if ($Algorithm -notin $SupportedAlgorithms) { + Write-Host "ERROR: Unsupported algorithm: $Algorithm. Supported: $($SupportedAlgorithms -join ', ')" + exit 1 + } + +} +# TOTP Generator (inline C# implementation) +Add-Type -Language CSharp @" +using System; +using System.Security.Cryptography; + +public static class Totp +{ + private const string B32 = "ABCDEFGHIJKLMNOPQRSTUVWXYZ234567"; + + private static byte[] Base32Decode(string s) + { + s = s.TrimEnd('=').ToUpperInvariant(); + int byteCount = s.Length * 5 / 8; + byte[] bytes = new byte[byteCount]; + + int bitBuffer = 0, bitsLeft = 0, idx = 0; + foreach (char c in s) + { + int val = B32.IndexOf(c); + if (val < 0) throw new ArgumentException("Invalid Base32 char: " + c); + + bitBuffer = (bitBuffer << 5) | val; + bitsLeft += 5; + + if (bitsLeft >= 8) + { + bytes[idx++] = (byte)(bitBuffer >> (bitsLeft - 8)); + bitsLeft -= 8; + } + } + return bytes; + } + + private static HMAC GetHmacAlgorithm(string algorithm, byte[] key) + { + switch (algorithm.ToUpper()) + { + case "SHA1": + return new HMACSHA1(key); + case "SHA256": + return new HMACSHA256(key); + case "SHA512": + return new HMACSHA512(key); + default: + throw new ArgumentException("Unsupported algorithm: " + algorithm); + } + } + + public static string Now(string secret, int digits, int period, string algorithm = "SHA256") + { + byte[] key = Base32Decode(secret); + long counter = DateTimeOffset.UtcNow.ToUnixTimeSeconds() / period; + + byte[] cnt = BitConverter.GetBytes(counter); + if (BitConverter.IsLittleEndian) Array.Reverse(cnt); + + byte[] hash; + using (var hmac = GetHmacAlgorithm(algorithm, key)) + { + hash = hmac.ComputeHash(cnt); + } + + int offset = hash[hash.Length - 1] & 0x0F; + int binary = + ((hash[offset] & 0x7F) << 24) | + ((hash[offset + 1] & 0xFF) << 16) | + ((hash[offset + 2] & 0xFF) << 8) | + (hash[offset + 3] & 0xFF); + + int otp = binary % (int)Math.Pow(10, digits); + return otp.ToString(new string('0', digits)); + } +} +"@ + +function Get-TotpCode { + param([string]$Secret, [int]$Digits = 6, [int]$Period = 30, [string]$Algorithm = 'SHA256') + [Totp]::Now($Secret, $Digits, $Period, $Algorithm) +} + +# Launch SimplySign Desktop (registry should auto-open login dialog) +Write-Host "Launching SimplySign Desktop..." +Write-Host "Registry pre-configuration should auto-open login dialog" +$proc = Start-Process -FilePath $ExePath -PassThru +if (-not $proc) { + Write-Error "Failed to start SimplySign Desktop" + exit 1 +} + +# Verify process is actually running +Start-Sleep -Milliseconds 500 +$proc.Refresh() +if ($proc.HasExited) { + Write-Error "SimplySign Desktop exited immediately after launch (exit code: $($proc.ExitCode))" + exit 1 +} +Write-Host "Process started with ID: $($proc.Id)" +Write-Host "" + +# Create WScript.Shell for window interaction +$wshell = New-Object -ComObject WScript.Shell + +# WinAPI for reliable window management +Add-Type @" +using System; +using System.Runtime.InteropServices; +using System.Collections.Generic; +using System.Text; +public class WinAPI { + [DllImport("user32.dll")] + public static extern bool EnumWindows(EnumWindowsProc enumProc, IntPtr lParam); + [DllImport("user32.dll")] + public static extern int GetWindowText(IntPtr hWnd, StringBuilder text, int count); + [DllImport("user32.dll")] + public static extern uint GetWindowThreadProcessId(IntPtr hWnd, out uint processId); + [DllImport("user32.dll")] + public static extern bool IsWindowVisible(IntPtr hWnd); + [DllImport("user32.dll")] + public static extern bool SetForegroundWindow(IntPtr hWnd); + [DllImport("user32.dll")] + public static extern IntPtr GetForegroundWindow(); + [DllImport("user32.dll")] + public static extern bool GetWindowRect(IntPtr hWnd, out RECT lpRect); + public delegate bool EnumWindowsProc(IntPtr hWnd, IntPtr lParam); + + public struct RECT { public int Left; public int Top; public int Right; public int Bottom; } + + public static List GetVisibleWindows(uint pid) { + var list = new List(); + EnumWindows((hWnd, lParam) => { + uint wPid; + GetWindowThreadProcessId(hWnd, out wPid); + if (wPid == pid && IsWindowVisible(hWnd)) { + var sb = new StringBuilder(256); + GetWindowText(hWnd, sb, 256); + if (sb.Length > 0) list.Add(hWnd); + } + return true; + }, IntPtr.Zero); + return list; + } +} +"@ + +function Get-SimplySignWindows { + return [WinAPI]::GetVisibleWindows([uint32]$proc.Id) +} + +function Stop-Processing { + param([string]$Reason) + Write-Host "ERROR: $Reason" + exit 1 +} + +function Set-WindowFocus { + param( + [IntPtr]$Handle, + [int]$MaxAttempts = 10, + [int]$DelayMs = 500 + ) + + for ($i = 1; $i -le $MaxAttempts; $i++) { + [WinAPI]::SetForegroundWindow($Handle) | Out-Null + Start-Sleep -Milliseconds $DelayMs + + $foreground = [WinAPI]::GetForegroundWindow() + if ($foreground -eq $Handle) { + Write-Host "Window focused successfully on attempt $i" + Write-Host "" + return $true + } + + Write-Host "Focus attempt $i of $MaxAttempts failed, retrying..." + } + + return $false +} + +# ------------------------------------------------------------------ +# Helpers added for reliable credential injection and popup recovery +# ------------------------------------------------------------------ + +function Get-WindowTitle { + param([IntPtr]$Handle) + $sb = New-Object System.Text.StringBuilder 256 + [WinAPI]::GetWindowText($Handle, $sb, 256) | Out-Null + return $sb.ToString() +} + +function Get-WindowGeometry { + param([IntPtr]$Handle) + $rect = New-Object 'WinAPI+RECT' + [WinAPI]::GetWindowRect($Handle, [ref]$rect) | Out-Null + return [PSCustomObject]@{ + Left = $rect.Left + Top = $rect.Top + Width = $rect.Right - $rect.Left + Height = $rect.Bottom - $rect.Top + } +} + +function Write-WindowTitles { + param([string]$Context) + $wins = @(Get-SimplySignWindows) + Write-Host "[$Context] Visible windows: $($wins.Count)" + foreach ($h in $wins) { + $g = Get-WindowGeometry -Handle $h + Write-Host " - handle=$h title='$(Get-WindowTitle -Handle $h)' size=$($g.Width)x$($g.Height) pos=($($g.Left),$($g.Top))" + } +} + + +# Diagnostic screenshot — opt-in only (login email is visible, so never on by +# default for public users). Enabled via CAPTURE_DIAGNOSTICS=true in our tests. +# Each capture is numbered with an incrementing counter so repeated stages (e.g. +# a popup or submit on every retry) are all preserved, not overwritten — and the +# files sort in chronological order. +$script:diagSeq = 0 +function Save-Screenshot { + param([string]$Stage) + if ($env:CAPTURE_DIAGNOSTICS -ne 'true') { return } + try { + Add-Type -AssemblyName System.Windows.Forms -ErrorAction Stop + Add-Type -AssemblyName System.Drawing -ErrorAction Stop + $bounds = [System.Windows.Forms.SystemInformation]::VirtualScreen + $bmp = New-Object System.Drawing.Bitmap $bounds.Width, $bounds.Height + $g = [System.Drawing.Graphics]::FromImage($bmp) + $g.CopyFromScreen($bounds.Location, [System.Drawing.Point]::Empty, $bounds.Size) + $safe = ($Stage -replace '[^A-Za-z0-9_-]', '_') + $script:diagSeq++ + $seq = '{0:D3}' -f $script:diagSeq + $path = Join-Path (Get-Location) "simplysign-diag-$seq-$safe.png" + $bmp.Save($path, [System.Drawing.Imaging.ImageFormat]::Png) + $g.Dispose(); $bmp.Dispose() + Write-Host "Saved diagnostic screenshot: $path" + } catch { + Write-Host "Screenshot capture failed: $($_.Exception.Message)" + } +} + +# Record (for the test workflow) that a modal popup recovery path actually ran. +function Set-DialogHandledFlag { + if ($env:GITHUB_ENV -and (Test-Path $env:GITHUB_ENV)) { + "SS_DIALOG_HANDLED=true" | Out-File -FilePath $env:GITHUB_ENV -Append -Encoding utf8 + } +} + +# Generate a TOTP code with a healthy slice of its ~Period-second window left. +# SimplySign shows a ~29s window and validates a few seconds after submit, so a +# code sent in the back half of the window can be rejected as stale. If under +# 20s remain, wait for the next period so we always submit early in the window. +function Get-FreshTotpCode { + $secondsLeft = $Period - ([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() % $Period) + Write-Host "TOTP window: $secondsLeft s remaining (period: $Period s)" + if ($secondsLeft -lt 20) { + $wait = $secondsLeft + 1 + Write-Host "Under 20s left — waiting ${wait}s for a fresh period to submit early in the window..." + Start-Sleep -Seconds $wait + } + $code = Get-TotpCode -Secret $Base32 -Digits $Digits -Period $Period -Algorithm $Algorithm + $left = $Period - ([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() % $Period) + Write-Host "TOTP generated (algorithm: $Algorithm) with ~${left}s of validity" + return $code +} + +# The TOTP period counter (which 30s window we are in). Used to guarantee a +# recovery resubmit never reuses the window of an attempt that just failed. +function Get-TotpPeriod { + return [math]::Floor([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() / $Period) +} + +# Records the period of the most recent submission so recovery can wait past it. +$script:lastSubmitPeriod = -1 + +# Generate a recovery code from a period STRICTLY NEWER than the last submit. +# SimplySign rejects a code from a window in which a prior attempt already failed +# (frame 006: a correct-looking ID+token resubmitted in the same period was still +# refused), so we wait for the next window and submit at the start of it. +function Get-RecoveryTotpCode { + while ((Get-TotpPeriod) -le $script:lastSubmitPeriod) { + $secondsLeft = $Period - ([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() % $Period) + Write-Host "Waiting ${secondsLeft}s for a new TOTP period (last submit used period $($script:lastSubmitPeriod))..." + Start-Sleep -Seconds ($secondsLeft + 1) + } + $code = Get-TotpCode -Secret $Base32 -Digits $Digits -Period $Period -Algorithm $Algorithm + $left = $Period - ([DateTimeOffset]::UtcNow.ToUnixTimeSeconds() % $Period) + Write-Host "Recovery TOTP generated (algorithm: $Algorithm) with ~${left}s of validity" + return $code +} + +# Enter credentials via the clipboard (Ctrl+V) instead of streaming keystrokes. +# SendKeys on Qt fields intermittently drops/reorders characters (a single lost +# digit => "Invalid user name or token"); an atomic paste removes that failure +# class. Fields are cleared first to drop any pre-filled/residual content. +function Invoke-CredentialSubmit { + param([IntPtr]$Handle, [string]$Otp) + + if (-not (Set-WindowFocus -Handle $Handle)) { + Write-Host "WARNING: could not focus login dialog before submit" + } + Start-Sleep -Milliseconds 400 + + # Diagnostic: dialog state before we type anything (is ID pre-filled/empty? + # which field has focus?). + Save-Screenshot -Stage "before-fill" + + # ID field (focused on a fresh dialog): clear, then paste username + Set-Clipboard -Value $UserId + $wshell.SendKeys("^a"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("{DEL}"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("^v"); Start-Sleep -Milliseconds 250 + + # Diagnostic: where did the username text actually land? + Save-Screenshot -Stage "after-userid" + + # Move to the Token field: clear, then paste the one-time code + $wshell.SendKeys("{TAB}"); Start-Sleep -Milliseconds 250 + Set-Clipboard -Value $Otp + $wshell.SendKeys("^a"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("{DEL}"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("^v"); Start-Sleep -Milliseconds 250 + + # Submit + $wshell.SendKeys("{ENTER}") + $script:lastSubmitPeriod = Get-TotpPeriod + Start-Sleep -Milliseconds 300 + + # Diagnostic: result right after submit, before any popup appears. + Save-Screenshot -Stage "after-submit" + + # Clear the clipboard so the secret token does not linger + Set-Clipboard -Value ' ' +} + +# Re-enter only the token after dismissing an "Invalid user name or token" +# dialog. SimplySign leaves the ID value intact and the (now empty) Token field +# focused, so the full ID->Tab->Token sequence would instead paste the username +# into the focused Token field. Here we paste only the fresh code into the +# already-focused Token field and submit — no window re-focus and no Tab (either +# would move input off the Token field). +function Invoke-TokenResubmit { + param([string]$Otp) + + # Diagnostic: dialog state before the token-only resubmit (where is focus, + # does the ID field still hold its value?). + Save-Screenshot -Stage "before-token-resubmit" + + Set-Clipboard -Value $Otp + $wshell.SendKeys("^a"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("{DEL}"); Start-Sleep -Milliseconds 120 + $wshell.SendKeys("^v"); Start-Sleep -Milliseconds 250 + + $wshell.SendKeys("{ENTER}") + $script:lastSubmitPeriod = Get-TotpPeriod + Start-Sleep -Milliseconds 300 + + # Diagnostic: result right after the token-only resubmit. + Save-Screenshot -Stage "after-token-resubmit" + + # Clear the clipboard so the secret token does not linger + Set-Clipboard -Value ' ' +} + +# Dismiss a modal popup (update "New version" dialog OR "Invalid user name or +# token" error). Titles are identical, so we cannot tell them apart — instead +# use a ladder that re-checks after each step and NEVER presses the update +# dialog's default "Yes" (which would start a download): Alt+N selects "No"; +# Tab+Space activates the focused "No"; Enter (last) can only reach an OK-only +# error box once any Yes/No dialog is already gone. Returns $true if cleared. +function Resolve-Popup { + param([IntPtr]$LoginHandle) + + $popups = @(Get-CertumPopupWindows -LoginHandle $loginHandle) + if ($popups.Count -eq 0) { return $false } + + $popup = $popups[0] + # Titles are identical, so log geometry to tell the dialogs apart from text + # logs alone (privacy-safe — no screenshot needed). The "New version found" + # update prompt (#2, Yes/No, more text) is wider than the short "Invalid user + # name or token" error box (#3, OK only); the width is a heuristic, not exact. + $g = Get-WindowGeometry -Handle $popup + $guess = if ($g.Width -ge 400) { 'likely #2 update dialog (Yes/No)' } else { 'likely #3 error dialog (OK only)' } + Write-Host "Modal popup detected: handle=$popup title='$(Get-WindowTitle -Handle $popup)' size=$($g.Width)x$($g.Height) pos=($($g.Left),$($g.Top)) — $guess" + Save-Screenshot -Stage "popup" + + $ladder = @( + @{ Keys = '%n'; Desc = 'Alt+N (No)' }, + @{ Keys = '{TAB} '; Desc = 'Tab + Space (activate No)' }, + @{ Keys = '{ENTER}'; Desc = 'Enter (OK on error dialog)' } + ) + + foreach ($step in $ladder) { + Set-WindowFocus -Handle $popup | Out-Null + Start-Sleep -Milliseconds 200 + $wshell.SendKeys($step.Keys) + Write-Host "Dismissal attempt: $($step.Desc)" + Start-Sleep -Milliseconds 800 + + $remaining = @(Get-CertumPopupWindows -LoginHandle $loginHandle) + if ($remaining.Count -eq 0) { + Write-Host "Popup dismissed via $($step.Desc)" + Set-DialogHandledFlag + return $true + } + $popup = $remaining[0] + } + + Write-Host "WARNING: popup still present after dismissal ladder" + return $false +} + +. (Join-Path $PSScriptRoot "../certum-login-ui.ps1") +Write-Host "Waiting for the SimplySign credential form, not its splash window..." +try { + $loginHandle = Wait-CertumLoginWindow +} catch { + if ($ProbeOnly) { + Write-WindowTitles -Context 'credential-free probe failure' + Save-Screenshot -Stage 'credential-free-probe' + } + throw +} +Write-WindowTitles -Context "credential form ready" +Write-Host "Login window: handle=$loginHandle title='$(Get-WindowTitle -Handle $loginHandle)'" +if ($ProbeOnly) { + Write-Host 'SimplySign native credential controls verified without authentication.' + exit 0 +} + +# Clear a recognised acknowledgement dialog before trying to focus the form. +Resolve-Popup -LoginHandle $loginHandle | Out-Null +if (-not (Set-WindowFocus -Handle $loginHandle)) { + Stop-Processing "Could not focus login dialog for credential injection" +} +# Small delay to ensure window is ready for input +Start-Sleep -Seconds 2 + +# Give the async version-check a brief chance to raise the "New version" dialog +# and dismiss it before we inject, so it cannot steal focus mid-submit. +$settle = 0 +while ($settle -lt 6) { + if (Resolve-Popup -LoginHandle $loginHandle) { + Set-WindowFocus -Handle $loginHandle | Out-Null + Start-Sleep -Milliseconds 500 + } + Start-Sleep -Seconds 1 + $settle++ +} + +# First credential submission +$forceBad = ($env:SS_TEST_FORCE_BAD_FIRST_TOKEN -eq 'true') +$otp = Get-FreshTotpCode +if ($forceBad) { + Write-Host "TEST HOOK: SS_TEST_FORCE_BAD_FIRST_TOKEN=true — first submit uses a deliberately invalid token" + # Guarantee a value different from the real code so it is always rejected. + $submitOtp = if ($otp -eq ('0' * $Digits)) { '1' * $Digits } else { '0' * $Digits } +} else { + $submitOtp = $otp +} + +Write-Host "Injecting credentials (clipboard paste): ID -> TAB -> Token -> ENTER..." +Invoke-CredentialSubmit -Handle $loginHandle -Otp $submitOtp +Write-Host "Credentials submitted" +Write-Host "" + +# Wait for the certificate; recover from any modal popup (invalid token / update) +Write-Host "Waiting for certificate to become available..." +$maxWaitSeconds = 180 +$elapsed = 0 +$match = $null +$retries = 0 +# Modest cap, kept deliberately bounded: too many bad submissions can lock the +# Certum account, so this is NOT unbounded. Each recovery cycle waits for a fresh +# TOTP period (~30s) + validation, so 5 attempts comfortably fit the 180s window. +$maxRetries = 5 + +while ($elapsed -lt $maxWaitSeconds) { + $signingCerts = Get-ChildItem -Path 'Cert:\CurrentUser\My' -ErrorAction SilentlyContinue | + Where-Object { $_.EnhancedKeyUsageList -like '*Code Signing*' } + + $match = $signingCerts | Where-Object { $_.Thumbprint -eq $KeyId } + + if ($match) { + Write-Host "Certificate available after $elapsed seconds" + break + } + + # A modal popup means the previous submit was rejected (or an update dialog + # appeared). Dismiss it and re-submit with a fresh TOTP code. + $popups = @(Get-CertumPopupWindows -LoginHandle $loginHandle) + if ($popups.Count -gt 0) { + if ($retries -ge $maxRetries) { + # Out of recovery attempts and the rejection dialog is still up — the + # credential is being rejected every time (e.g. a bad token will never + # recover). Fail fast with a precise reason instead of idling out the + # remaining wait window doing nothing. + Save-Screenshot -Stage "rejected" + Write-WindowTitles -Context "credential rejected" + Write-Error "Credential rejected $retries times (modal popup still present) — aborting. The submitted username/token was not accepted." + exit 1 + } + + $retries++ + Write-Host "" + Write-Host "Popup detected during wait (attempt $retries/$maxRetries) — recovering..." + if (Resolve-Popup -LoginHandle $loginHandle) { + # After dismissing the error dialog, SimplySign keeps the ID value and + # leaves the empty Token field focused, so refill ONLY the token — do not + # re-focus the window or re-enter the ID (either moves input off Token). + # Use a code from a brand-new TOTP period: the server rejects a code from + # a window in which a submit already failed (so wait past the last one). + Start-Sleep -Milliseconds 500 + $freshOtp = Get-RecoveryTotpCode + Write-Host "Re-submitting a fresh-period token into the focused Token field..." + Invoke-TokenResubmit -Otp $freshOtp + } + Write-Host "" + } + + Write-Host "Certificate not yet available, retrying... ($elapsed/$maxWaitSeconds seconds)" + Start-Sleep -Seconds 5 + $elapsed += 5 +} + +if (-not $match) { + Save-Screenshot -Stage "final-failure" + Write-WindowTitles -Context "final failure" + Write-Error "Certificate with thumbprint '$KeyId' not found after $maxWaitSeconds seconds" + exit 1 +} + +# Verify SimplySign Desktop is still running +$stillRunning = Get-Process -Id $proc.Id -ErrorAction SilentlyContinue +if ($stillRunning) { + Write-Host "SUCCESS: SimplySign Desktop is running" + Write-Host "Authentication should be complete" + Write-Host "Cloud certificate should now be available" +} else { + Write-Host "WARNING: SimplySign Desktop process has exited" + Write-Host "This may indicate authentication failure" +} + +Write-Host "" +Write-Host "=== TOTP AUTHENTICATION COMPLETE ===" +Write-Host "Registry pre-configuration + credential injection finished" diff --git a/scripts/certum/Install-SimplySign.ps1 b/scripts/certum/Install-SimplySign.ps1 new file mode 100644 index 000000000..496d2bf6b --- /dev/null +++ b/scripts/certum/Install-SimplySign.ps1 @@ -0,0 +1,33 @@ +param([string]$InstallerPath = 'SimplySignDesktop.msi') +$ErrorActionPreference = 'Stop' +if (-not (Test-Path -LiteralPath $InstallerPath)) { + Invoke-WebRequest 'https://files.certum.eu/software/SimplySignDesktop/Windows/9.4.3.90/SimplySignDesktop-9.4.3.90-64-bit-en.msi' -OutFile $InstallerPath -TimeoutSec 90 +} +if ((Get-FileHash -Algorithm SHA256 -LiteralPath $InstallerPath).Hash -ne 'CE2B38EF0124A574BC08E5558726099CAAC79A7C58B8D3D712F629371FE1BCB7') { + throw 'SimplySign installer does not match the pinned 9.4.3.90 build.' +} +$signature = Get-AuthenticodeSignature -LiteralPath $InstallerPath +if ($signature.Status -ne 'Valid' -or $signature.SignerCertificate.Subject -notmatch 'Asseco Data Systems') { + throw 'SimplySign installer publisher signature is not trusted.' +} +$process = Start-Process msiexec.exe -ArgumentList @('/i', ('"' + (Resolve-Path $InstallerPath).Path + '"'), '/quiet', '/norestart', 'ALLUSERS=1', 'REBOOT=ReallySuppress') -PassThru +$null = $process.Handle +if (-not $process.WaitForExit(300000)) { + $process | Stop-Process -Force + throw 'SimplySign installation did not finish within five minutes.' +} +if ($process.ExitCode -ne 0) { throw "SimplySign installation failed: $($process.ExitCode)" } +$installPath = Join-Path $env:ProgramFiles 'Certum\SimplySign Desktop' +if (-not (Test-Path -LiteralPath (Join-Path $installPath 'SimplySignDesktop.exe'))) { + throw 'Verified SimplySign executable is missing after installation.' +} +$registry = 'HKCU:\Software\Certum\SimplySign' +New-Item -Path $registry -Force | Out-Null +# Same settings as the pinned upstream action; no credentials are stored here. +$settings = @{ ShowLoginDialogOnStart = 1; ShowLoginDialogOnAppRequest = 1; RememberLastUserName = 1; Autostart = 0; UnregisterCertificatesOnDisconnect = 0; RememberPINinCSP = 1; ForgetPINinCSPonDisconnect = 1; LangID = 9 } +foreach ($name in $settings.Keys) { + New-ItemProperty -Path $registry -Name $name -Value $settings[$name] -PropertyType DWord -Force | Out-Null +} +$env:SS_PATH = $installPath +if ($env:GITHUB_ENV) { "SS_PATH=$installPath" >> $env:GITHUB_ENV } +Write-Host 'Pinned SimplySign client installed and configured.' diff --git a/scripts/certum/UPSTREAM-LICENSE b/scripts/certum/UPSTREAM-LICENSE new file mode 100644 index 000000000..3c7493127 --- /dev/null +++ b/scripts/certum/UPSTREAM-LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2025 dismine + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE.