From 1cfd00a39e23f98835c44b3db3f744240bcd1a3f Mon Sep 17 00:00:00 2001 From: Thomas Date: Mon, 9 Nov 2026 16:33:29 +0100 Subject: [PATCH] Free code signing: self-signed certs + one-click trust installers (Windows + macOS) Generate a free self-signed code-signing certificate per platform and make trusting it flawless for users; CI signs both platforms when the signing secrets are present. - scripts/make-windows-cert.ps1: generates the Windows cert (.pfx) and a self-elevating "Install Tether certificate.cmd" with the cert embedded (certutil, Root + TrustedPublisher). - scripts/make-macos-cert.sh: generates the macOS cert (.p12) and a "Trust Tether.mobileconfig" profile (double-click install, no Terminal). - scripts/trust-windows-cert.ps1 / trust-macos-cert.sh: scripted/fleet trust install from the published .cer (GPO/Intune or per-user). - scripts/install-macos.sh: curl install that sets no quarantine, so Gatekeeper never prompts. - desktop.yml: sign the NSIS setup with the self-signed cert (WINDOWS_SIGNING_P12), inert without the secret; optional SignPath Foundation step for CA trust once approved. - Download page (release.rs): a Mark-of-the-Web-free PowerShell install command next to the Windows Download button, built in-browser from the relay origin; test added. - certs/: the public certs and both double-click installers (publish to each relay /download/). - docs/code-signing.md: the full free-signing plan and the exhausted research (no free CA/Apple- trusted cert exists for an individual; SignPath for Windows and the Apple fee waiver are the only universal-trust free routes). LICENSE, PRIVACY.md, CODE_SIGNING_POLICY.md prepared for SignPath. - .gitignore: never track signing private keys (secret/, *.pfx, *.p12). --- .github/workflows/desktop.yml | 39 ++ .gitignore | 5 + CODE_SIGNING_POLICY.md | 36 ++ LICENSE | 661 +++++++++++++++++++++++++++ PRIVACY.md | 25 + README.md | 10 +- apps/manage/src-tauri/src/release.rs | 45 +- certs/Install Tether certificate.cmd | 32 ++ certs/Trust Tether.mobileconfig | 19 + certs/tether-codesign-macos.cer | Bin 0 -> 1094 bytes certs/tether-codesign.cer | Bin 0 -> 1040 bytes docs/code-signing.md | 219 ++++++++- scripts/install-macos.sh | 49 ++ scripts/make-macos-cert.sh | 57 +++ scripts/make-windows-cert.ps1 | 62 +++ scripts/trust-macos-cert.sh | 31 ++ scripts/trust-windows-cert.ps1 | 31 ++ 17 files changed, 1298 insertions(+), 23 deletions(-) create mode 100644 CODE_SIGNING_POLICY.md create mode 100644 LICENSE create mode 100644 PRIVACY.md create mode 100644 certs/Install Tether certificate.cmd create mode 100644 certs/Trust Tether.mobileconfig create mode 100644 certs/tether-codesign-macos.cer create mode 100644 certs/tether-codesign.cer create mode 100644 scripts/install-macos.sh create mode 100644 scripts/make-macos-cert.sh create mode 100644 scripts/make-windows-cert.ps1 create mode 100644 scripts/trust-macos-cert.sh create mode 100644 scripts/trust-windows-cert.ps1 diff --git a/.github/workflows/desktop.yml b/.github/workflows/desktop.yml index 092d7d7..97af18c 100644 --- a/.github/workflows/desktop.yml +++ b/.github/workflows/desktop.yml @@ -10,6 +10,8 @@ env: TETHER_PUB_KEY: ${{ secrets.TETHER_PUB_KEY }} TETHER_ADMIN_PUB_KEY: ${{ secrets.TETHER_ADMIN_PUB_KEY }} TETHER_UPDATER_PUB_KEY: ${{ secrets.TETHER_UPDATER_PUB_KEY }} + SIGNPATH_API_TOKEN: ${{ secrets.SIGNPATH_API_TOKEN }} + WINDOWS_SIGNING_P12: ${{ secrets.WINDOWS_SIGNING_P12 }} jobs: build: @@ -50,10 +52,47 @@ jobs: working-directory: apps/desktop shell: bash run: npx tauri build --target ${{ matrix.target }} --bundles nsis + # Free self-signed Authenticode (scripts/make-windows-cert.ps1), mirroring the macOS cert. + # Gives a stable publisher identity and full trust on fleets that deploy the .cer (GPO/Intune); + # inert without the secret. Superseded by the SignPath step below once that is approved. + - name: Sign (self-signed) + if: env.WINDOWS_SIGNING_P12 != '' && github.event_name != 'pull_request' + shell: pwsh + env: + P12: ${{ secrets.WINDOWS_SIGNING_P12 }} + P12_PASSWORD: ${{ secrets.WINDOWS_SIGNING_PASSWORD }} + run: | + $dir = "apps/desktop/src-tauri/target/${{ matrix.target }}/release/bundle/nsis" + [IO.File]::WriteAllBytes("$env:RUNNER_TEMP\cs.pfx", [Convert]::FromBase64String($env:P12)) + $c = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new("$env:RUNNER_TEMP\cs.pfx", $env:P12_PASSWORD) + Get-ChildItem "$dir/*.exe" | ForEach-Object { + $r = Set-AuthenticodeSignature -FilePath $_.FullName -Certificate $c -HashAlgorithm SHA256 -TimestampServer 'http://timestamp.digicert.com' + if ($r.Status -ne 'Valid') { throw "signing $($_.Name): $($r.Status) $($r.StatusMessage)" } + "signed $($_.Name)" + } + Remove-Item "$env:RUNNER_TEMP\cs.pfx" -Force - uses: actions/upload-artifact@v4 + id: upload with: name: tether-${{ matrix.target }} path: apps/desktop/src-tauri/target/${{ matrix.target }}/release/bundle/nsis/*.exe + # Free Authenticode signing by SignPath Foundation (docs/code-signing.md). Inert until the + # project is accepted and the secret SIGNPATH_API_TOKEN and the repo variables exist. + - name: Sign (SignPath) + if: env.SIGNPATH_API_TOKEN != '' && github.event_name != 'pull_request' + uses: signpath/github-action-submit-signing-request@v3 + with: + api-token: ${{ secrets.SIGNPATH_API_TOKEN }} + organization-id: ${{ vars.SIGNPATH_ORGANIZATION_ID }} + project-slug: tether + signing-policy-slug: release-signing + github-artifact-id: ${{ steps.upload.outputs.artifact-id }} + output-artifact-directory: signed + - if: hashFiles('signed/**') != '' + uses: actions/upload-artifact@v4 + with: + name: tether-${{ matrix.target }}-signed + path: signed/ # Unsigned universal build (Apple silicon + Intel), the same script as on a developer Mac. macos: diff --git a/.gitignore b/.gitignore index 2ba0284..2d1be66 100644 --- a/.gitignore +++ b/.gitignore @@ -14,3 +14,8 @@ __pycache__/ # Tether Manage key backups (encrypted, but never commit them) backup-keys/ *.tmkeys + +# signing private keys never go in git (public .cer/.cmd/.mobileconfig are fine) +*.pfx +*.p12 +/secret/ diff --git a/CODE_SIGNING_POLICY.md b/CODE_SIGNING_POLICY.md new file mode 100644 index 0000000..715c928 --- /dev/null +++ b/CODE_SIGNING_POLICY.md @@ -0,0 +1,36 @@ +# Code signing policy + +Free code signing provided by [SignPath.io](https://about.signpath.io), certificate by +[SignPath Foundation](https://signpath.org). + +Status: application pending; until it is accepted, Windows releases are unsigned. + +Only Windows files built by this repository's GitHub Actions workflow (`.github/workflows/desktop.yml`) +from the tagged source are signed. Every signing request is approved by hand. + +## Team roles + +| Role | Members | +| --- | --- | +| Committers and reviewers | [fnpanic](https://github.com/fnpanic) | +| Approvers | [fnpanic](https://github.com/fnpanic) | + +All members use multi-factor authentication on GitHub and SignPath. + +## Privacy + +This program will not transfer any information to other networked systems unless specifically +requested by the user or the person installing or operating it. It talks only to the relay servers +of the organization that provides it; see [PRIVACY.md](PRIVACY.md). + +## System changes + +The Windows installer adds two inbound firewall rules named "Tether" (TCP 21118 and UDP 21119, local +subnet only, for direct connections) and, if unattended access is chosen, the Windows service +"Tether". The uninstaller removes both. + +## Third-party components + +Tether is AGPL-3.0 ([LICENSE](LICENSE)) and builds on RustDesk (AGPL-3.0) and other open-source +libraries; their sources are fetched by `scripts/bootstrap.sh` with the patches in `patches/`. +Third-party binaries that are not built here (Microsoft WebView2) are not signed by this project. diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0ad25db --- /dev/null +++ b/LICENSE @@ -0,0 +1,661 @@ + GNU AFFERO GENERAL PUBLIC LICENSE + Version 3, 19 November 2007 + + Copyright (C) 2007 Free Software Foundation, Inc. + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + + Preamble + + The GNU Affero General Public License is a free, copyleft license for +software and other kinds of works, specifically designed to ensure +cooperation with the community in the case of network server software. + + The licenses for most software and other practical works are designed +to take away your freedom to share and change the works. By contrast, +our General Public Licenses are intended to guarantee your freedom to +share and change all versions of a program--to make sure it remains free +software for all its users. + + When we speak of free software, we are referring to freedom, not +price. Our General Public Licenses are designed to make sure that you +have the freedom to distribute copies of free software (and charge for +them if you wish), that you receive source code or can get it if you +want it, that you can change the software or use pieces of it in new +free programs, and that you know you can do these things. + + Developers that use our General Public Licenses protect your rights +with two steps: (1) assert copyright on the software, and (2) offer +you this License which gives you legal permission to copy, distribute +and/or modify the software. + + A secondary benefit of defending all users' freedom is that +improvements made in alternate versions of the program, if they +receive widespread use, become available for other developers to +incorporate. Many developers of free software are heartened and +encouraged by the resulting cooperation. However, in the case of +software used on network servers, this result may fail to come about. +The GNU General Public License permits making a modified version and +letting the public access it on a server without ever releasing its +source code to the public. + + The GNU Affero General Public License is designed specifically to +ensure that, in such cases, the modified source code becomes available +to the community. It requires the operator of a network server to +provide the source code of the modified version running there to the +users of that server. Therefore, public use of a modified version, on +a publicly accessible server, gives the public access to the source +code of the modified version. + + An older license, called the Affero General Public License and +published by Affero, was designed to accomplish similar goals. This is +a different license, not a version of the Affero GPL, but Affero has +released a new version of the Affero GPL which permits relicensing under +this license. + + The precise terms and conditions for copying, distribution and +modification follow. + + TERMS AND CONDITIONS + + 0. Definitions. + + "This License" refers to version 3 of the GNU Affero General Public License. + + "Copyright" also means copyright-like laws that apply to other kinds of +works, such as semiconductor masks. + + "The Program" refers to any copyrightable work licensed under this +License. Each licensee is addressed as "you". "Licensees" and +"recipients" may be individuals or organizations. + + To "modify" a work means to copy from or adapt all or part of the work +in a fashion requiring copyright permission, other than the making of an +exact copy. The resulting work is called a "modified version" of the +earlier work or a work "based on" the earlier work. + + A "covered work" means either the unmodified Program or a work based +on the Program. + + To "propagate" a work means to do anything with it that, without +permission, would make you directly or secondarily liable for +infringement under applicable copyright law, except executing it on a +computer or modifying a private copy. Propagation includes copying, +distribution (with or without modification), making available to the +public, and in some countries other activities as well. + + To "convey" a work means any kind of propagation that enables other +parties to make or receive copies. Mere interaction with a user through +a computer network, with no transfer of a copy, is not conveying. + + An interactive user interface displays "Appropriate Legal Notices" +to the extent that it includes a convenient and prominently visible +feature that (1) displays an appropriate copyright notice, and (2) +tells the user that there is no warranty for the work (except to the +extent that warranties are provided), that licensees may convey the +work under this License, and how to view a copy of this License. If +the interface presents a list of user commands or options, such as a +menu, a prominent item in the list meets this criterion. + + 1. Source Code. + + The "source code" for a work means the preferred form of the work +for making modifications to it. "Object code" means any non-source +form of a work. + + A "Standard Interface" means an interface that either is an official +standard defined by a recognized standards body, or, in the case of +interfaces specified for a particular programming language, one that +is widely used among developers working in that language. + + The "System Libraries" of an executable work include anything, other +than the work as a whole, that (a) is included in the normal form of +packaging a Major Component, but which is not part of that Major +Component, and (b) serves only to enable use of the work with that +Major Component, or to implement a Standard Interface for which an +implementation is available to the public in source code form. A +"Major Component", in this context, means a major essential component +(kernel, window system, and so on) of the specific operating system +(if any) on which the executable work runs, or a compiler used to +produce the work, or an object code interpreter used to run it. + + The "Corresponding Source" for a work in object code form means all +the source code needed to generate, install, and (for an executable +work) run the object code and to modify the work, including scripts to +control those activities. However, it does not include the work's +System Libraries, or general-purpose tools or generally available free +programs which are used unmodified in performing those activities but +which are not part of the work. For example, Corresponding Source +includes interface definition files associated with source files for +the work, and the source code for shared libraries and dynamically +linked subprograms that the work is specifically designed to require, +such as by intimate data communication or control flow between those +subprograms and other parts of the work. + + The Corresponding Source need not include anything that users +can regenerate automatically from other parts of the Corresponding +Source. + + The Corresponding Source for a work in source code form is that +same work. + + 2. Basic Permissions. + + All rights granted under this License are granted for the term of +copyright on the Program, and are irrevocable provided the stated +conditions are met. This License explicitly affirms your unlimited +permission to run the unmodified Program. The output from running a +covered work is covered by this License only if the output, given its +content, constitutes a covered work. This License acknowledges your +rights of fair use or other equivalent, as provided by copyright law. + + You may make, run and propagate covered works that you do not +convey, without conditions so long as your license otherwise remains +in force. You may convey covered works to others for the sole purpose +of having them make modifications exclusively for you, or provide you +with facilities for running those works, provided that you comply with +the terms of this License in conveying all material for which you do +not control copyright. Those thus making or running the covered works +for you must do so exclusively on your behalf, under your direction +and control, on terms that prohibit them from making any copies of +your copyrighted material outside their relationship with you. + + Conveying under any other circumstances is permitted solely under +the conditions stated below. Sublicensing is not allowed; section 10 +makes it unnecessary. + + 3. Protecting Users' Legal Rights From Anti-Circumvention Law. + + No covered work shall be deemed part of an effective technological +measure under any applicable law fulfilling obligations under article +11 of the WIPO copyright treaty adopted on 20 December 1996, or +similar laws prohibiting or restricting circumvention of such +measures. + + When you convey a covered work, you waive any legal power to forbid +circumvention of technological measures to the extent such circumvention +is effected by exercising rights under this License with respect to +the covered work, and you disclaim any intention to limit operation or +modification of the work as a means of enforcing, against the work's +users, your or third parties' legal rights to forbid circumvention of +technological measures. + + 4. Conveying Verbatim Copies. + + You may convey verbatim copies of the Program's source code as you +receive it, in any medium, provided that you conspicuously and +appropriately publish on each copy an appropriate copyright notice; +keep intact all notices stating that this License and any +non-permissive terms added in accord with section 7 apply to the code; +keep intact all notices of the absence of any warranty; and give all +recipients a copy of this License along with the Program. + + You may charge any price or no price for each copy that you convey, +and you may offer support or warranty protection for a fee. + + 5. Conveying Modified Source Versions. + + You may convey a work based on the Program, or the modifications to +produce it from the Program, in the form of source code under the +terms of section 4, provided that you also meet all of these conditions: + + a) The work must carry prominent notices stating that you modified + it, and giving a relevant date. + + b) The work must carry prominent notices stating that it is + released under this License and any conditions added under section + 7. This requirement modifies the requirement in section 4 to + "keep intact all notices". + + c) You must license the entire work, as a whole, under this + License to anyone who comes into possession of a copy. This + License will therefore apply, along with any applicable section 7 + additional terms, to the whole of the work, and all its parts, + regardless of how they are packaged. This License gives no + permission to license the work in any other way, but it does not + invalidate such permission if you have separately received it. + + d) If the work has interactive user interfaces, each must display + Appropriate Legal Notices; however, if the Program has interactive + interfaces that do not display Appropriate Legal Notices, your + work need not make them do so. + + A compilation of a covered work with other separate and independent +works, which are not by their nature extensions of the covered work, +and which are not combined with it such as to form a larger program, +in or on a volume of a storage or distribution medium, is called an +"aggregate" if the compilation and its resulting copyright are not +used to limit the access or legal rights of the compilation's users +beyond what the individual works permit. Inclusion of a covered work +in an aggregate does not cause this License to apply to the other +parts of the aggregate. + + 6. Conveying Non-Source Forms. + + You may convey a covered work in object code form under the terms +of sections 4 and 5, provided that you also convey the +machine-readable Corresponding Source under the terms of this License, +in one of these ways: + + a) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by the + Corresponding Source fixed on a durable physical medium + customarily used for software interchange. + + b) Convey the object code in, or embodied in, a physical product + (including a physical distribution medium), accompanied by a + written offer, valid for at least three years and valid for as + long as you offer spare parts or customer support for that product + model, to give anyone who possesses the object code either (1) a + copy of the Corresponding Source for all the software in the + product that is covered by this License, on a durable physical + medium customarily used for software interchange, for a price no + more than your reasonable cost of physically performing this + conveying of source, or (2) access to copy the + Corresponding Source from a network server at no charge. + + c) Convey individual copies of the object code with a copy of the + written offer to provide the Corresponding Source. This + alternative is allowed only occasionally and noncommercially, and + only if you received the object code with such an offer, in accord + with subsection 6b. + + d) Convey the object code by offering access from a designated + place (gratis or for a charge), and offer equivalent access to the + Corresponding Source in the same way through the same place at no + further charge. You need not require recipients to copy the + Corresponding Source along with the object code. If the place to + copy the object code is a network server, the Corresponding Source + may be on a different server (operated by you or a third party) + that supports equivalent copying facilities, provided you maintain + clear directions next to the object code saying where to find the + Corresponding Source. Regardless of what server hosts the + Corresponding Source, you remain obligated to ensure that it is + available for as long as needed to satisfy these requirements. + + e) Convey the object code using peer-to-peer transmission, provided + you inform other peers where the object code and Corresponding + Source of the work are being offered to the general public at no + charge under subsection 6d. + + A separable portion of the object code, whose source code is excluded +from the Corresponding Source as a System Library, need not be +included in conveying the object code work. + + A "User Product" is either (1) a "consumer product", which means any +tangible personal property which is normally used for personal, family, +or household purposes, or (2) anything designed or sold for incorporation +into a dwelling. In determining whether a product is a consumer product, +doubtful cases shall be resolved in favor of coverage. For a particular +product received by a particular user, "normally used" refers to a +typical or common use of that class of product, regardless of the status +of the particular user or of the way in which the particular user +actually uses, or expects or is expected to use, the product. A product +is a consumer product regardless of whether the product has substantial +commercial, industrial or non-consumer uses, unless such uses represent +the only significant mode of use of the product. + + "Installation Information" for a User Product means any methods, +procedures, authorization keys, or other information required to install +and execute modified versions of a covered work in that User Product from +a modified version of its Corresponding Source. The information must +suffice to ensure that the continued functioning of the modified object +code is in no case prevented or interfered with solely because +modification has been made. + + If you convey an object code work under this section in, or with, or +specifically for use in, a User Product, and the conveying occurs as +part of a transaction in which the right of possession and use of the +User Product is transferred to the recipient in perpetuity or for a +fixed term (regardless of how the transaction is characterized), the +Corresponding Source conveyed under this section must be accompanied +by the Installation Information. But this requirement does not apply +if neither you nor any third party retains the ability to install +modified object code on the User Product (for example, the work has +been installed in ROM). + + The requirement to provide Installation Information does not include a +requirement to continue to provide support service, warranty, or updates +for a work that has been modified or installed by the recipient, or for +the User Product in which it has been modified or installed. Access to a +network may be denied when the modification itself materially and +adversely affects the operation of the network or violates the rules and +protocols for communication across the network. + + Corresponding Source conveyed, and Installation Information provided, +in accord with this section must be in a format that is publicly +documented (and with an implementation available to the public in +source code form), and must require no special password or key for +unpacking, reading or copying. + + 7. Additional Terms. + + "Additional permissions" are terms that supplement the terms of this +License by making exceptions from one or more of its conditions. +Additional permissions that are applicable to the entire Program shall +be treated as though they were included in this License, to the extent +that they are valid under applicable law. If additional permissions +apply only to part of the Program, that part may be used separately +under those permissions, but the entire Program remains governed by +this License without regard to the additional permissions. + + When you convey a copy of a covered work, you may at your option +remove any additional permissions from that copy, or from any part of +it. (Additional permissions may be written to require their own +removal in certain cases when you modify the work.) You may place +additional permissions on material, added by you to a covered work, +for which you have or can give appropriate copyright permission. + + Notwithstanding any other provision of this License, for material you +add to a covered work, you may (if authorized by the copyright holders of +that material) supplement the terms of this License with terms: + + a) Disclaiming warranty or limiting liability differently from the + terms of sections 15 and 16 of this License; or + + b) Requiring preservation of specified reasonable legal notices or + author attributions in that material or in the Appropriate Legal + Notices displayed by works containing it; or + + c) Prohibiting misrepresentation of the origin of that material, or + requiring that modified versions of such material be marked in + reasonable ways as different from the original version; or + + d) Limiting the use for publicity purposes of names of licensors or + authors of the material; or + + e) Declining to grant rights under trademark law for use of some + trade names, trademarks, or service marks; or + + f) Requiring indemnification of licensors and authors of that + material by anyone who conveys the material (or modified versions of + it) with contractual assumptions of liability to the recipient, for + any liability that these contractual assumptions directly impose on + those licensors and authors. + + All other non-permissive additional terms are considered "further +restrictions" within the meaning of section 10. If the Program as you +received it, or any part of it, contains a notice stating that it is +governed by this License along with a term that is a further +restriction, you may remove that term. If a license document contains +a further restriction but permits relicensing or conveying under this +License, you may add to a covered work material governed by the terms +of that license document, provided that the further restriction does +not survive such relicensing or conveying. + + If you add terms to a covered work in accord with this section, you +must place, in the relevant source files, a statement of the +additional terms that apply to those files, or a notice indicating +where to find the applicable terms. + + Additional terms, permissive or non-permissive, may be stated in the +form of a separately written license, or stated as exceptions; +the above requirements apply either way. + + 8. Termination. + + You may not propagate or modify a covered work except as expressly +provided under this License. Any attempt otherwise to propagate or +modify it is void, and will automatically terminate your rights under +this License (including any patent licenses granted under the third +paragraph of section 11). + + However, if you cease all violation of this License, then your +license from a particular copyright holder is reinstated (a) +provisionally, unless and until the copyright holder explicitly and +finally terminates your license, and (b) permanently, if the copyright +holder fails to notify you of the violation by some reasonable means +prior to 60 days after the cessation. + + Moreover, your license from a particular copyright holder is +reinstated permanently if the copyright holder notifies you of the +violation by some reasonable means, this is the first time you have +received notice of violation of this License (for any work) from that +copyright holder, and you cure the violation prior to 30 days after +your receipt of the notice. + + Termination of your rights under this section does not terminate the +licenses of parties who have received copies or rights from you under +this License. If your rights have been terminated and not permanently +reinstated, you do not qualify to receive new licenses for the same +material under section 10. + + 9. Acceptance Not Required for Having Copies. + + You are not required to accept this License in order to receive or +run a copy of the Program. Ancillary propagation of a covered work +occurring solely as a consequence of using peer-to-peer transmission +to receive a copy likewise does not require acceptance. However, +nothing other than this License grants you permission to propagate or +modify any covered work. These actions infringe copyright if you do +not accept this License. Therefore, by modifying or propagating a +covered work, you indicate your acceptance of this License to do so. + + 10. Automatic Licensing of Downstream Recipients. + + Each time you convey a covered work, the recipient automatically +receives a license from the original licensors, to run, modify and +propagate that work, subject to this License. You are not responsible +for enforcing compliance by third parties with this License. + + An "entity transaction" is a transaction transferring control of an +organization, or substantially all assets of one, or subdividing an +organization, or merging organizations. If propagation of a covered +work results from an entity transaction, each party to that +transaction who receives a copy of the work also receives whatever +licenses to the work the party's predecessor in interest had or could +give under the previous paragraph, plus a right to possession of the +Corresponding Source of the work from the predecessor in interest, if +the predecessor has it or can get it with reasonable efforts. + + You may not impose any further restrictions on the exercise of the +rights granted or affirmed under this License. For example, you may +not impose a license fee, royalty, or other charge for exercise of +rights granted under this License, and you may not initiate litigation +(including a cross-claim or counterclaim in a lawsuit) alleging that +any patent claim is infringed by making, using, selling, offering for +sale, or importing the Program or any portion of it. + + 11. Patents. + + A "contributor" is a copyright holder who authorizes use under this +License of the Program or a work on which the Program is based. The +work thus licensed is called the contributor's "contributor version". + + A contributor's "essential patent claims" are all patent claims +owned or controlled by the contributor, whether already acquired or +hereafter acquired, that would be infringed by some manner, permitted +by this License, of making, using, or selling its contributor version, +but do not include claims that would be infringed only as a +consequence of further modification of the contributor version. For +purposes of this definition, "control" includes the right to grant +patent sublicenses in a manner consistent with the requirements of +this License. + + Each contributor grants you a non-exclusive, worldwide, royalty-free +patent license under the contributor's essential patent claims, to +make, use, sell, offer for sale, import and otherwise run, modify and +propagate the contents of its contributor version. + + In the following three paragraphs, a "patent license" is any express +agreement or commitment, however denominated, not to enforce a patent +(such as an express permission to practice a patent or covenant not to +sue for patent infringement). To "grant" such a patent license to a +party means to make such an agreement or commitment not to enforce a +patent against the party. + + If you convey a covered work, knowingly relying on a patent license, +and the Corresponding Source of the work is not available for anyone +to copy, free of charge and under the terms of this License, through a +publicly available network server or other readily accessible means, +then you must either (1) cause the Corresponding Source to be so +available, or (2) arrange to deprive yourself of the benefit of the +patent license for this particular work, or (3) arrange, in a manner +consistent with the requirements of this License, to extend the patent +license to downstream recipients. "Knowingly relying" means you have +actual knowledge that, but for the patent license, your conveying the +covered work in a country, or your recipient's use of the covered work +in a country, would infringe one or more identifiable patents in that +country that you have reason to believe are valid. + + If, pursuant to or in connection with a single transaction or +arrangement, you convey, or propagate by procuring conveyance of, a +covered work, and grant a patent license to some of the parties +receiving the covered work authorizing them to use, propagate, modify +or convey a specific copy of the covered work, then the patent license +you grant is automatically extended to all recipients of the covered +work and works based on it. + + A patent license is "discriminatory" if it does not include within +the scope of its coverage, prohibits the exercise of, or is +conditioned on the non-exercise of one or more of the rights that are +specifically granted under this License. You may not convey a covered +work if you are a party to an arrangement with a third party that is +in the business of distributing software, under which you make payment +to the third party based on the extent of your activity of conveying +the work, and under which the third party grants, to any of the +parties who would receive the covered work from you, a discriminatory +patent license (a) in connection with copies of the covered work +conveyed by you (or copies made from those copies), or (b) primarily +for and in connection with specific products or compilations that +contain the covered work, unless you entered into that arrangement, +or that patent license was granted, prior to 28 March 2007. + + Nothing in this License shall be construed as excluding or limiting +any implied license or other defenses to infringement that may +otherwise be available to you under applicable patent law. + + 12. No Surrender of Others' Freedom. + + If conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot convey a +covered work so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you may +not convey it at all. For example, if you agree to terms that obligate you +to collect a royalty for further conveying from those to whom you convey +the Program, the only way you could satisfy both those terms and this +License would be to refrain entirely from conveying the Program. + + 13. Remote Network Interaction; Use with the GNU General Public License. + + Notwithstanding any other provision of this License, if you modify the +Program, your modified version must prominently offer all users +interacting with it remotely through a computer network (if your version +supports such interaction) an opportunity to receive the Corresponding +Source of your version by providing access to the Corresponding Source +from a network server at no charge, through some standard or customary +means of facilitating copying of software. This Corresponding Source +shall include the Corresponding Source for any work covered by version 3 +of the GNU General Public License that is incorporated pursuant to the +following paragraph. + + Notwithstanding any other provision of this License, you have +permission to link or combine any covered work with a work licensed +under version 3 of the GNU General Public License into a single +combined work, and to convey the resulting work. The terms of this +License will continue to apply to the part which is the covered work, +but the work with which it is combined will remain governed by version +3 of the GNU General Public License. + + 14. Revised Versions of this License. + + The Free Software Foundation may publish revised and/or new versions of +the GNU Affero General Public License from time to time. Such new versions +will be similar in spirit to the present version, but may differ in detail to +address new problems or concerns. + + Each version is given a distinguishing version number. If the +Program specifies that a certain numbered version of the GNU Affero General +Public License "or any later version" applies to it, you have the +option of following the terms and conditions either of that numbered +version or of any later version published by the Free Software +Foundation. If the Program does not specify a version number of the +GNU Affero General Public License, you may choose any version ever published +by the Free Software Foundation. + + If the Program specifies that a proxy can decide which future +versions of the GNU Affero General Public License can be used, that proxy's +public statement of acceptance of a version permanently authorizes you +to choose that version for the Program. + + Later license versions may give you additional or different +permissions. However, no additional obligations are imposed on any +author or copyright holder as a result of your choosing to follow a +later version. + + 15. Disclaimer of Warranty. + + THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY +APPLICABLE LAW. EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT +HOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY +OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM +IS WITH YOU. SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF +ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. Limitation of Liability. + + IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING +WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS +THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY +GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE +USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF +DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD +PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS), +EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF +SUCH DAMAGES. + + 17. Interpretation of Sections 15 and 16. + + If the disclaimer of warranty and limitation of liability provided +above cannot be given local legal effect according to their terms, +reviewing courts shall apply local law that most closely approximates +an absolute waiver of all civil liability in connection with the +Program, unless a warranty or assumption of liability accompanies a +copy of the Program in return for a fee. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Programs + + If you develop a new program, and you want it to be of the greatest +possible use to the public, the best way to achieve this is to make it +free software which everyone can redistribute and change under these terms. + + To do so, attach the following notices to the program. It is safest +to attach them to the start of each source file to most effectively +state the exclusion of warranty; and each file should have at least +the "copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This program is free software: you can redistribute it and/or modify + it under the terms of the GNU Affero General Public License as published + by the Free Software Foundation, either version 3 of the License, or + (at your option) any later version. + + This program is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + GNU Affero General Public License for more details. + + You should have received a copy of the GNU Affero General Public License + along with this program. If not, see . + +Also add information on how to contact you by electronic and paper mail. + + If your software can interact with users remotely through a computer +network, you should also make sure that it provides a way for users to +get its source. For example, if your program is a web application, its +interface could display a "Source" link that leads users to an archive +of the code. There are many ways you could offer source, and different +solutions will be better for different programs; see section 13 for the +specific requirements. + + You should also get your employer (if you work as a programmer) or school, +if any, to sign a "copyright disclaimer" for the program, if necessary. +For more information on this, and how to apply and follow the GNU AGPL, see +. diff --git a/PRIVACY.md b/PRIVACY.md new file mode 100644 index 0000000..fd69950 --- /dev/null +++ b/PRIVACY.md @@ -0,0 +1,25 @@ +# Privacy policy + +Tether and TetherQS send no data to the Tether developers or to third parties. They talk only to the +relay servers chosen by the organization that gave you the app (built into the app or set by that +organization's signed policy). That organization runs those servers and is responsible for the data on them. + +What goes to those relay servers: + +| Data | Why | Stored | +| --- | --- | --- | +| Device ID, IP address, app version, online status | Connecting technician and device | while online | +| Screen, input, clipboard, files and audio of a session | The remote session itself; encrypted between the two devices, the relay only forwards it | not stored | +| Session audit record: time, device, technician name, IP address, duration, names of transferred files, security alarms | Accountability of remote access (shown in Tether Manage) | daily files, kept for the retention the organization sets | +| Update checks: app, channel, version | Offering signed updates | access logs of the relay | + +Session recordings are made only when recording is switched on and are saved on the technician's +computer. They are uploaded only if the organization's signed policy sets an upload target +(`recording.upload-target`), and then only to that target. + +If WebView2 is missing, the installer downloads it from Microsoft (go.microsoft.com), under Microsoft's +privacy statement. + +Opting out: audit records and update checks are part of the organization's policy; ask the +organization that provides the app. Uninstalling the app (Settings → Apps, or the uninstaller in the +install folder) stops all transfers. diff --git a/README.md b/README.md index 25d713a..6f694e4 100644 --- a/README.md +++ b/README.md @@ -80,5 +80,11 @@ Tether clients use only TCP 443: put `server/caddy/Caddyfile` (`tether-https.ser ## License -AGPL-3.0, inherited from RustDesk. You must offer the complete corresponding source, including -`patches/`, to everyone you distribute Tether to. +AGPL-3.0, inherited from RustDesk ([LICENSE](LICENSE)). You must offer the complete corresponding +source, including `patches/`, to everyone you distribute Tether to. + +## Code signing policy + +Free code signing provided by [SignPath.io](https://about.signpath.io), certificate by +[SignPath Foundation](https://signpath.org) (application pending). Team roles, privacy and system changes: +[CODE_SIGNING_POLICY.md](CODE_SIGNING_POLICY.md), [PRIVACY.md](PRIVACY.md). diff --git a/apps/manage/src-tauri/src/release.rs b/apps/manage/src-tauri/src/release.rs index 9c2468c..2c4c1b7 100644 --- a/apps/manage/src-tauri/src/release.rs +++ b/apps/manage/src-tauri/src/release.rs @@ -266,19 +266,36 @@ var mine=/mac/i.test(p)?"macos":/win/i.test(p)?"windows":""; var tabs=document.querySelectorAll(".switch a"); function pick(os){d.setAttribute("data-os",os);for(var i=0;i String { // One card per app with one download; signatures and updater archives are for the updater // (Tether Manage lists them under Releases), not for visitors. - let card = |o: &Offer| match &o.href { + // On Windows an installer downloaded by the browser gets the Mark of the Web, so SmartScreen + // warns on our unsigned setup. A copy-paste PowerShell line fetches it with Invoke-WebRequest, + // which sets no Mark of the Web (docs/code-signing.md), so no warning. The command's absolute + // URL is built in the browser from the relative href and this relay's origin (the page is + // served by several relays), so the generated HTML stays origin-free; without JS the Download + // button is the fallback. + let card = |o: &Offer, win: bool| match &o.href { Some(href) => format!( - "", + "
{}{}Download{}
", esc(o.label), esc(&o.detail), - esc(href) + esc(href), + if win { format!("", esc(href)) } else { String::new() }, ), None => format!("
{}Not available yet
", esc(o.label)), }; @@ -286,7 +303,8 @@ pub fn download_page(title: &str, intro: &str, sections: &[OsSection]) -> String let body: String = sections .iter() .map(|s| { - let cards: String = s.offers.iter().map(card).collect(); + let win = s.id == "windows"; + let cards: String = s.offers.iter().map(|o| card(o, win)).collect(); format!("

{}Your computer

{cards}
", s.id, esc(s.name)) }) .collect(); @@ -322,6 +340,9 @@ a:focus-visible{{outline:2px solid var(--focus);outline-offset:2px}} .detail{{margin-bottom:16px}} .cta{{align-self:flex-start;margin-top:auto;background:var(--accent);color:#fff;border-radius:9999px;padding:10px 22px;font-size:15px;text-decoration:none}} .cta:hover{{filter:brightness(1.1)}} +.copy{{display:none;align-self:flex-start;margin-top:12px;background:none;border:1px solid var(--accent);color:var(--accent);border-radius:9999px;padding:8px 18px;font:inherit;font-size:14px;cursor:pointer}} +.copy:hover{{background:var(--parchment)}} +.cmd{{display:none;margin-top:10px;padding:10px 12px;border-radius:10px;background:var(--parchment);color:var(--ink);font-family:ui-monospace,"SF Mono","Cascadia Code",Consolas,monospace;font-size:12px;line-height:1.45;overflow-x:auto;white-space:pre;user-select:all;-webkit-user-select:all}} .switch{{display:inline-flex;gap:4px;margin-top:32px;padding:4px;border-radius:9999px;background:var(--parchment)}} .switch a{{padding:8px 18px;border-radius:9999px;color:var(--ink);text-decoration:none;font-size:15px}} .switch a[aria-current=true]{{font-weight:600}} @@ -454,6 +475,20 @@ mod tests { assert!(html.contains(".cta{align-self:flex-start;margin-top:auto;")); } + #[test] + fn windows_cards_offer_a_mark_of_the_web_free_install_command() { + let html = download_page("T", "", §ions(Some("/download/stable/technician/darwin-universal/Tether_0.3.1_universal.dmg"))); + // A copy button per released Windows app (two), carrying the relative exe href; none on macOS. + let win = &html[html.find("id=\"windows\"").unwrap()..html.find("id=\"macos\"").unwrap()]; + assert_eq!(win.matches("class=\"copy\"").count(), 2); + assert!(win.contains("data-exe=\"/w.exe\"") && win.contains("")); + assert!(!html[html.find("id=\"macos\"").unwrap()..].contains("class=\"copy\"")); + // The command is assembled in the browser from this relay's origin: no absolute URL baked in, + // and it fetches with Invoke-WebRequest (no Mark of the Web) rather than a browser download. + assert!(!html.contains("https://") && !html.contains("http://")); + assert!(html.contains("location.origin+rel") && html.contains("iwr '") && html.contains("-OutFile $o; & $o")); + } + fn manifest(v: &str) -> Manifest { Manifest { version: v.into(), notes: "n".into(), pub_date: String::new(), platforms: BTreeMap::new(), mandatory: false, minimum_version: String::new(), forced: false } } diff --git a/certs/Install Tether certificate.cmd b/certs/Install Tether certificate.cmd new file mode 100644 index 0000000..fe318e9 --- /dev/null +++ b/certs/Install Tether certificate.cmd @@ -0,0 +1,32 @@ +@echo off +rem Installs the Tether code-signing certificate so Windows trusts Tether. Double-click it. +net session >nul 2>&1 || (powershell -NoProfile -Command "Start-Process -Verb RunAs -FilePath '%~f0'" & exit /b) +set "C=%TEMP%\tether-codesign.cer" +>"%C%" echo -----BEGIN CERTIFICATE----- +>>"%C%" echo MIIEDDCCAnSgAwIBAgIQQ3gQ/SzKfq5IRFvadJ6TzjANBgkqhkiG9w0BAQsFADAe +>>"%C%" echo MRwwGgYDVQQDDBNUZXRoZXIgQ29kZSBTaWduaW5nMB4XDTI2MTEwOTE1MDEwMVoX +>>"%C%" echo DTM2MTEwOTE1MTEwMFowHjEcMBoGA1UEAwwTVGV0aGVyIENvZGUgU2lnbmluZzCC +>>"%C%" echo AaIwDQYJKoZIhvcNAQEBBQADggGPADCCAYoCggGBAL8y7XLh2ENlS0JMUSCNL2Uz +>>"%C%" echo RLfu3uYktzrFgD52ZQ3fdrqQsFn/MmdoeFeFZCmGEYXbKJeHUKCG+iHpCERFUrDO +>>"%C%" echo ERLGyc631uDniNQ+TmoaEyKfv8okj2jozW8CIS63h7nd9bdtDYdceDuFmQzpNqY9 +>>"%C%" echo FtDuJ6KLeSf8PodlJxMG5MDfs7qD12hml3vueCvEQFWvyvExoP5MaB+le1E/pW93 +>>"%C%" echo VZzpizZfzWbvZtHn5f8VZWSlXphEuVILMPgyYNdyaPi1TG8cR0SeR8jawH0fwNus +>>"%C%" echo 4W5ZZZGdQGPv5Rxn5vBL6yjTQC/mcTbJw+MkjwLg3+SlliD0yso4mwd1x/F1XwCV +>>"%C%" echo BhPws970INi4oY7WIlxT8oCsoRaguo2Gt0739FYC0ai7UOQrjULFjecpmgVgwQcH +>>"%C%" echo UdCtwAiiHxTuH/IBY/F4tGE0CiOZX+4B3sVGpQ72iObgvYoLC2eFdauItcHtJxJY +>>"%C%" echo eAAF6btQd755NxzbnJxGGwn0FB9H/JfhFuaavbUSVQIDAQABo0YwRDAOBgNVHQ8B +>>"%C%" echo Af8EBAMCB4AwEwYDVR0lBAwwCgYIKwYBBQUHAwMwHQYDVR0OBBYEFCmuvsR4z1oU +>>"%C%" echo JnRqo+Oa0IiS3XLoMA0GCSqGSIb3DQEBCwUAA4IBgQA5shzLYnczclDq+xKHeE+c +>>"%C%" echo Sww7Jcp5lkmWsaesktzIwGiT2CNQCb9NSshQLdSNYadWCSPiKOIpw3NgynnBBxHK +>>"%C%" echo 37lhSh2AP+J5bGCfy0cMWtFp0Kk8i0zXpq6r65Yp4n4a1ZWzD6AXon6Pd9rDYqsa +>>"%C%" echo TUv5vOTSmXeyj1StE9Z/OveTaeb/E6DtsqSWawwVtnSGDml57/l0gbvdotFDIqAP +>>"%C%" echo nlI2APwOQZQ4FmvVfeNWXqdauaXjSLycDamMYdHt+p3sJE8+hNRMhH75EPe7ENZs +>>"%C%" echo P761CbsqIiQd8w1c9apHmZcx2aoYzfv8Qb4gV/0YwDuqmFDIB8yCHYfs5YPgeesb +>>"%C%" echo aO88hK7zXIvQ0qZaBs7+Sj0LgT9zk7YTplwkG4D9OeEOY98lFj5lNedopMNFmbfH +>>"%C%" echo CAg5PDn1vTg6dCXIC4cbFe4AGyA2XAC9TZr4m10Nh5KPXVGOGw8xid8UzxcAHB+k +>>"%C%" echo yTzL1aOY5tU3vqQikzxPXrHi36ZvlGF1kNlKLveZk9c= +>>"%C%" echo -----END CERTIFICATE----- +certutil -addstore -f Root "%C%" >nul && certutil -addstore -f TrustedPublisher "%C%" >nul && (echo Tether certificate installed.) || (echo Install FAILED.) +del "%C%" >nul 2>&1 +echo. +pause diff --git a/certs/Trust Tether.mobileconfig b/certs/Trust Tether.mobileconfig new file mode 100644 index 0000000..d8f2ec4 --- /dev/null +++ b/certs/Trust Tether.mobileconfig @@ -0,0 +1,19 @@ + + + + PayloadContent + + PayloadTypecom.apple.security.root + PayloadContentMIIEQjCCAqqgAwIBAgIUE0Dade1E5hHtUJir9oWab1dvNmEwDQYJKoZIhvcNAQELBQAwHjEcMBoGA1UEAwwTVGV0aGVyIENvZGUgU2lnbmluZzAeFw0yNjExMDkxNTEyNTZaFw0zNjExMDYxNTEyNTZaMB4xHDAaBgNVBAMME1RldGhlciBDb2RlIFNpZ25pbmcwggGiMA0GCSqGSIb3DQEBAQUAA4IBjwAwggGKAoIBgQDkQTs1HfLKaBeAlfa5lalxSIaWf0cPpdj4x/jDRGoNF3BKSReU7gFPM+lPHooDBDuWClAzBPbzVxMb701DdHQElrxVRqF4CssSRFht8n8GyMm2di7kvWrF78ejJOtnMOPdki+uafW464oBVVxlCSdluoExE8SizXAYGN+vJgxnrxZgpjmzcw9A9haYOdMVhP0H0CVaoAeyVEe1n+/eLNT/U0/UH/LnMhBIcQu00v5qHsaVH5Dherevfk548I1qDSr0xi6S4PdFmFRbpZUSDwA8zf7QtQbIV3dUYl+Z8fmsM3XXSqyW9ircULhZ5sSn4lLa6Y/ADCxPRbsAHeh/e+0UwHUr9wcTjpaXRZX3SRgd1rhiYM47SV1Z6PNvcbMX49CiBBuZ66pkiPTM7AKtb9G62gAauhg+AwA0gskhRg2FR849LTJnZzjPL3r/36OYZddNm2KESMbLLMwD1ehd18ZTnfQX92Jg1ZhzAMB8g8M4RkwxeSWWJTZ9OKU1u6r//5ECAwEAAaN4MHYwHQYDVR0OBBYEFOjgEl0jPBH2NeJxxbEMU2wRmZt7MB8GA1UdIwQYMBaAFOjgEl0jPBH2NeJxxbEMU2wRmZt7MA4GA1UdDwEB/wQEAwIHgDAWBgNVHSUBAf8EDDAKBggrBgEFBQcDAzAMBgNVHRMBAf8EAjAAMA0GCSqGSIb3DQEBCwUAA4IBgQB5CzPwp7LUokosJK0T67RdX9cGiajTj8FNd6InIizNVOVZVl6E60N8+IrqLHFmDlXaIoWLh/sTfk8tvR0SpUOVk2P/i8ufVwaKoF0JKVlRHbOq4KW2GbXgtdP2QWVWiWEnXh70YVEa1hg/1+Uhgo8PtgMVHzztIuJpQUbNtK3XtM8R3WDbEMwwL29217wDn9Y4mKltocx96vofhZ14gertJE1ldAXBneUeBdmNYFf9m3lJZhJi3dguXUM/tsjAKiVP2L/7/sgL5OpkvDSx1B+/Eb09+mfaLsT951VHm02wzwdgup2n4LU79kBQbRcJpaEUOQm+OOi2tVoz3ddUFnYvWDegrcnSdz/mjhyPYdnfp+Jz5kKIwZf2mVuXGM/ZXdkrmZ9kGpTSbHBstvkQMvXqZxVTQRrKpO56L88oBUOISuhyn8jSB8pTd44EB6J934dwipNRWDS9vchwi1WYHaGqKhFvYjiuBgz/eS4iIssGESWG9nmEY6ehNDiF9Ixy0FU= + PayloadIdentifiernet.tether.cert.246a7997-3808-d1a1-ab74-322e98089313 + PayloadUUID246a7997-3808-d1a1-ab74-322e98089313 + PayloadVersion1 + PayloadDisplayNameTether Code Signing + + PayloadDisplayNameTrust Tether + PayloadDescriptionTrusts Tether's code-signing certificate on this Mac. + PayloadIdentifiernet.tether.trust.f54aee21-19a0-7e6a-5f18-6a6e6b3e21ab + PayloadTypeConfiguration + PayloadUUIDf54aee21-19a0-7e6a-5f18-6a6e6b3e21ab + PayloadVersion1 + diff --git a/certs/tether-codesign-macos.cer b/certs/tether-codesign-macos.cer new file mode 100644 index 0000000000000000000000000000000000000000..0f1bb0ca160c4c404cc2d3b4e6470a02d4de458c GIT binary patch literal 1094 zcmXqLVsSEPVp_F;nTe5!NkrJ;R_R-pXM%47W~~0!Ix9as-z?F9myJ`a&7^~y{>Cr;<+_+ztfz4W7_)r)94;*V-q*RLgk{>EP`8B@ zT&IOxB62^~vz<7(txWI9-mIhVk1tkvoo?{>?j-$nnO}Fj?qUp$N##^e-PLF)d}Ptt z0tt!x>(zMD*NY`Av)o+F@9<4*hUI0^mcQ&5RHGKKZwhhWI{*DWoh$!?{jbP>dTu1( zQOLdJ(!VUZV^ifPJgnNjzRs`WLvI$Z)|X>?lOB9`oe>hfbgB?PgU#807q+sU2rmyw zil6!M=NjYE>t1W7ebc%Vup{!>k>!tqZoTY3z@y{ux|>1vMSb;KkprdL-`R!xrcHO9 z`rT7P_S%l5gmc!Ov5_x6=NE1ke|%vPi}cLbt5Q0?oO#2vHvi(TTMSaWB8^quV3~5{^A*_*L`OvwRjvmt#gL?>WkRx$Aag65&xc)aCJs8!-1OS z!xnBnhLx(*RLyEFmYVKf_5c4wCT2zk#>Eu|Wd^dqR3OX8BE}-};(<`CvW?(3(?^9z zH}VAM2+o{cZ6FVlR%Vef5Np7$fDfdApONuD3kx$7dxL=(h_4Fb^B8ckacHwKva+%> zGaK-L#DziPOa=_dX#G|PoT?=A4H6sIM zH?MlIberVX2U{c3!E{~&o8^ahk5=riy13(7oMqo^-I2WZbjp(w<^A=C9DVMK9ys=*_#mlcXp*` zno!c+8+x(M_S;Sz&{FlkvH$nK6WmW;rR*`;ctw7{;9lEb>9_Qb{CytkKHGQ0dG>@| zbC*BZYW>Y2AXl7o=|T}p&V3dywr!0vzI#1HtV}<`e8Jk2m&)y*^~v-n-n_s3QSmdU zj)T*`&5WKdasFoPP3@WUQ>3O`$|=a%_EW&<>#KCpU`MG_OWsxKpVwe@?(lk1H2=gU z_EW*-eJt#YYVWrfbWIM7Fxk8JL_v4x4B3UNv;^~$EY`8{{IAqgQaa5hsM_|evL$)> NLKBPDFFi#ULIJtG$-Dpn literal 0 HcmV?d00001 diff --git a/certs/tether-codesign.cer b/certs/tether-codesign.cer new file mode 100644 index 0000000000000000000000000000000000000000..790efa6c3d84683fb4fcabb35e0e60f21395671b GIT binary patch literal 1040 zcmXqLV&O4pVk%j{%*4pVB;Z^j@K@(l-8v7K=vyW8CZ99lW#iOp^Jx3d%gD&h%3vU8 zC}SYS#vIDR%p)9GINYYgQA z1r4GI>ThCPglr`vD+6;AV?TpI6Jr-s6JsO8extWV4{tc9dOP_9D)j278oO+Nckh|X zcB`Wec4eu&_se!o*bw>OC_SShyfsC$O|bR0#`N}p1#Q0+Uvjv(25mSeD0J-Px$V~; zJny(-=a(fVtTccBDV6?=7iaUC6!o^Z@4WkUdoFK#OoespOrDo!%WTCiyi;G)U8(-Z zu02&>ZnOBaY46i6 zK7aaOG&N;u+zgkULEHvEj1sOFW&GIclP}}$GSB_Qtpm042X3!JL z&pvp+*0}7T|E$pL{j#8(9-CN4G( zZ8k<$R(57)16hzDABz}^h~~O|M=H)oiKvxiEq*-fLdT@LMK6$J8ko3%G2O^uxk=`9 zQn_(az^mUv?G^rWym_ouPgPFyoVIcKnn`y~9LSh_LpgwRzpvMc0NpFSiOa({l^-&pl5r%`D&4AF@{XTD{fx$(hgo3om%PY00!~9?@+jZG4%P?|+sw z?!LR|qO;Nh{&_)W41f3>r&x$(U#)!{7PmZV=hDX>d*<-2>`A=%_Sf7uD*kpYSA1IP zehPfwEpRQze&1Hk-C9a2vY&ZlzOHhgIo&Z_zE-i~/download/...`, like `install-macos.sh`; the release pruner leaves top-level files alone): +`Install Tether certificate.cmd`, `Trust Tether.mobileconfig`, and the raw `tether-codesign.cer`. + +**Scripted / fleet alternative** (same effect, for IT automation): `scripts/trust-windows-cert.ps1` +(`-Machine` for all users, or push the `.cer` by GPO/Intune) and `scripts/trust-macos-cert.sh` +(`--machine` for all users). + +## Windows, free route 1: self-signed certificate (in hand now) + +`scripts/make-windows-cert.ps1` generates a real code-signing certificate for free (verified +2026-11-09: it signs with a timestamp; the embedded signer is `CN=Tether Code Signing`). Like the +macOS self-signed certificate, it is not trusted by default on a random PC, but: + +- **Managed fleets (full trust, free):** a customer's IT deploys the public `.cer` to Trusted Root + + Trusted Publishers via GPO or Intune; the apps are then fully trusted there — no SmartScreen, no + "Unknown publisher" — at no cost. This is the usual path for a B2B remote-support tool. +- **Stable publisher identity** for every build, instead of none. + +```powershell +pwsh scripts/make-windows-cert.ps1 -OutDir .\secret -Password +# keep tether-codesign.pfx + password secret (never commit); the .cer is public, for customers' IT +``` + +CI signs the NSIS setup with it when the secrets `WINDOWS_SIGNING_P12` (base64 of the .pfx) and +`WINDOWS_SIGNING_PASSWORD` exist (`desktop.yml`, step "Sign (self-signed)"); inert without them. +On an unmanaged PC this adds no trust by itself — pair it with the Mark-of-the-Web-free install +below, or use route 2 for universal trust. + +## Windows, free route 2: SignPath Foundation (CA-trusted) + +[Conditions](https://signpath.org/terms.html), checked against Tether: + +| Condition | Tether today | To do | | --- | --- | --- | -| Microsoft Store, **MSIX** submission: Microsoft re-signs the package | free (individual developer account free since 2025-09) | no, see below | -| Microsoft Store, MSI/EXE submission | the installer must already be signed with a CA certificate | no saving | -| Azure Artifact Signing (Trusted Signing) | ~$9.99/month | individuals only in the USA and Canada | -| OV certificate (Certum, Sectigo, ...), key in cloud HSM or token | Certum Open Source (cloud) from €49, standard ~€109-169/year, others $150-300/year | yes; Certum Open Source needs public source | -| SignPath Foundation | free for qualifying open-source projects | hardly: public OSI repo, CI builds, fork rules, publisher shown as "SignPath Foundation" | +| OSI license for all components, no commercial dual licensing, no proprietary parts (system libraries allowed) | AGPL-3.0 (RustDesk, rustdesk-server), Apache (webrtc-sctp); the installer bundles only `tether.exe` and Microsoft's WebView2 bootstrapper | add a `LICENSE` file at the repo root | +| Source repository the team owns; binaries built from source verifiably | `fnpanic/tether` is **private**; Windows builds already run in GitHub Actions (`desktop.yml`, `tauri build --bundles nsis`) | make the repo public (AGPL requires offering the source to users anyway); sign from the CI artifact via SignPath's GitHub action | +| Released already, functionality documented on the download page | yes (relay download page) | | +| "Code signing policy" section on home and download page: "Free code signing provided by SignPath.io, certificate by SignPath Foundation", team roles, privacy policy or no-transfer statement | missing | add to README and the download page | +| Privacy: data transfers need a privacy policy shown at install with an opt-out where unspecified | audit log, metrics and update checks go to your own relays | write a short privacy policy, link it in the installer | +| System changes only with proper warnings; matching uninstaller | firewall rules + service (hooks.nsh); NSIS uninstaller exists | name the firewall rules and the service in the installer text | +| No hacking tools | remote support with visible consent/session UI | describe the consent flow in the application | +| MFA for all team members on SignPath and GitHub; manual approval of every release | | enable; approve each signing request | + +**Prepared in the repo (2026-11-09):** `LICENSE` (AGPL-3.0), `CODE_SIGNING_POLICY.md` (attribution, +roles, privacy, system changes, third-party components), `PRIVACY.md`, the README section, and the CI +step in `desktop.yml` that submits the NSIS setup to SignPath (`signpath/github-action-submit-signing-request@v3`) +and uploads `tether--signed`. The step stays inert until the secret `SIGNPATH_API_TOKEN` exists. + +**Steps left (yours, outward-facing):** + +1. Make `fnpanic/tether` public (check history for secrets first: `git log -p | grep -i -E 'secret|password|BEGIN .*PRIVATE'`). +2. Enable MFA on GitHub; apply at [signpath.org/apply](https://signpath.org/) with the repo URL, the + download page and `CODE_SIGNING_POLICY.md`. +3. After acceptance: install the SignPath GitHub App, create project `tether` with signing policy + `release-signing`, add the secret `SIGNPATH_API_TOKEN` and the repo variable `SIGNPATH_ORGANIZATION_ID`. +4. Release the CI-signed setup (`tether-x86_64-pc-windows-msvc-signed`) instead of the local build, + change the download page footer (`apps/manage/src-tauri/src/release.rs` `page_render`, + `docs/examples/download-template.html`) to the attribution, and drop "(application pending)". + TetherQS needs the same: a CI job building it, signed by the same step. + +Precedents using the +same policy wording: [Pandoc](https://pandoc.org/code-signing-policy.html), +[Ink/Stitch](https://inkstitch.org/code-signing-policy), [Drawpile](https://drawpile.net/codesigningpolicy/), +[OpenRCT2](https://openrct2.io/code-signing-policy). Risk: SignPath may reject at its discretion (no +remote-desktop project was found among its signed projects); the fallback is an OV certificate +(Certum Open Source, cloud key, from about €49/year). Signed binaries also fix Smart App Control, +which blocks unsigned apps however they were downloaded. + +### Until then: install without the Mark of the Web + +SmartScreen reacts only to files carrying the Mark of the Web (`Zone.Identifier` stream), which +browsers add. Checked on this Windows 11 PC on 2026-11-09: + +``` +Invoke-WebRequest ... -OutFile iwr.bin → Zone.Identifier: False +curl.exe -o curl.bin ... → Zone.Identifier: False +``` + +The relay download page offers this per Windows app as a second option **next to the Download button** +(`apps/manage/src-tauri/src/release.rs` `download_page`): a "Copy install command (no security prompt)" +button. The browser builds the line from the page's own origin and the release's path, so it is correct +on whichever relay serves the page: -## Why the free Store/MSIX path does not fit +```powershell +powershell -NoProfile -Command "$o=Join-Path $env:TEMP 'tether-setup.exe'; iwr '/download/.../Tether_x64-setup.exe' -OutFile $o; & $o" +``` + +`iwr` (Invoke-WebRequest) writes no Mark of the Web, so SmartScreen does not warn; the normal Download +link stays as the fallback and for browsers with JavaScript off. UAC still says "Unknown publisher" +(unsigned), and Smart App Control, when on, still blocks. Defender's ML detections are unaffected; only +a signature and reputation help there. + +## macOS: no free certificate, free Gatekeeper-free install + +Gatekeeper assesses an app only when the file carries `com.apple.quarantine`, which browsers set and +`curl` does not (Apple DTS: "most Unix-y tools don't quarantine their downloads, including curl"; +[forum thread](https://developer.apple.com/forums/thread/706273), [who decides to quarantine +files](https://eclecticlight.co/2025/12/08/who-decides-to-quarantine-files/)). So: + +1. **Signature:** keep the self-signed `Tether Code Signing` certificate (already in CI). macOS ties + Screen Recording/Accessibility to its designated requirement, so permissions survive updates. +2. **First install:** `scripts/install-macos.sh`, published on every relay as + `/data/download/install-macos.sh` (served at `https:///download/install-macos.sh`; the + release pruner only touches `///` folders): + ```sh + curl -fsSL https:///download/install-macos.sh | sh -s -- https:// # Tether + curl -fsSL https:///download/install-macos.sh | sh -s -- https:// customer # TetherQS + curl -fsSL https:///download/install-macos.sh | sh -s -- 'https:///q//mac' # custom app + ``` + It reads `latest.json`, downloads over HTTPS only, checks the bundle id and + `codesign --verify --deep --strict`, installs into /Applications (or ~/Applications), and opens it. + No "Open Anyway", no admin password. +3. **Updates:** the apps download updates themselves (no quarantine), so no prompt after the first install. + +Limits: the script must be trusted like the relay (HTTPS); Apple fixes Gatekeeper bypasses, but the +curl behaviour is documented, long-standing, and how Homebrew's installer and rustup work. +A customer has to paste one Terminal line, about as much effort as "Open Anyway" with its password. +**Research conclusion (2026-11-09, searched to exhaustion):** there is no free Gatekeeper-trusted +certificate for an individual, and no foundation or third-party service notarizes open-source macOS +apps for free (notarization needs your own Developer ID certificate, which comes only with the paid +program; [Apple forum 121113](https://developer.apple.com/forums/thread/121113), +[GoReleaser](https://goreleaser.com/customization/sign/notarize/), [Tauri notarization](https://www.electron.build/docs/features/code-signing/notarization/)). +SignPath signs Windows only, not Apple. + +The one fee-free trusted route is an organization: a nonprofit (e.g. a German e.V., which needs seven +founders and charitable status from the tax office), accredited school, or government gets the Apple +Developer Program by [fee waiver](https://developer.apple.com/support/fee-waiver), with a D-U-N-S number +(free), free apps only, no in-app purchases. That yields a real Developer ID + notarization at no cost. +For a bare individual, the free route is the self-signed certificate + curl install above (works, no +cost, not Apple-trusted). To remove every warning on a browser download without an org, $99/year for Developer ID + notarization is the only way; +CI already accepts a Developer ID identity (`APPLE_SIGNING_IDENTITY` secret), notarization is not wired yet. + +## Microsoft Store / MSIX: free signature, but it does not fit + +Microsoft re-signs MSIX packages submitted to the Store for free (developer accounts are free), but: - **Store-only.** The free signature exists only on the package the Store distributes. Downloads from our relays, the CDN or the download page stay unsigned; a self-built MSIX outside the Store @@ -23,13 +202,21 @@ and [distribution paths](https://learn.microsoft.com/windows/apps/package-and-de `install_bytes`) and TetherQS swaps its own exe (`apps/quick/src-tauri/src/update.rs` `install`): neither works in an MSIX. Store builds are updated by the Store only, after certification of each release (hours to days), so the signed release index, rollout ramp, halt/resume, the relays' - release-hint push and custom apps would not apply to them. + release-hint push and custom apps would not apply to them. MSIX's own off-Store updater (an + `.appinstaller` file on our server, polled by App Installer) still needs a CA-trusted signature + and would replace our updater, so it saves no certificate. - **Installer actions.** The NSIS installer creates Windows firewall rules (hooks.nsh) and, for unattended access, a Windows service; MSIX can declare services only as a restricted capability that Store review must approve, and does not run custom install scripts. - **TetherQS** is a portable exe a customer runs once without installing; a Store install defeats that, and per-customer custom-app downloads (signed profile in the download) are impossible. -A Store build would be a second product with its own update path beside the current one, and the -files on the download page would remain unsigned. The practical route is an OV certificate in -cloud signing (Certum), integrated into the release build with `signtool` and a timestamp. +## Other options considered + +| Option | Cost | Note | +| --- | --- | --- | +| Azure Artifact Signing (Trusted Signing) | ~$9.99/month | individuals only in the USA and Canada; organizations also EU/UK | +| OV certificate, key in cloud HSM | Certum Open Source from ~€49/year, others $150-300/year | fallback if SignPath declines | +| EV certificate | $400+/year | no SmartScreen advantage over OV since 2024 | +| Sigstore | free | not trusted for Authenticode or Gatekeeper | +| Self-signed / own CA | free | trusted only where the certificate is installed (managed fleets via Intune/GPO or MDM) | diff --git a/scripts/install-macos.sh b/scripts/install-macos.sh new file mode 100644 index 0000000..637f0b8 --- /dev/null +++ b/scripts/install-macos.sh @@ -0,0 +1,49 @@ +#!/bin/sh +# Install Tether or TetherQS on macOS without the Gatekeeper "Open Anyway" step, at no cost. +# Files fetched with curl carry no com.apple.quarantine flag, and Gatekeeper only assesses +# quarantined files (docs/code-signing.md). Trust comes from HTTPS to our own relay plus a strict +# codesign check of the bundle, the same as a browser download (which Gatekeeper rejects anyway, +# since the apps are not notarized). +# +# curl -fsSL https:///download/install-macos.sh | sh -s -- https:// [technician|customer] +# curl -fsSL https:///download/install-macos.sh | sh -s -- 'https:///q//mac' +set -eu + +src=${1:?usage: install-macos.sh https:// [technician|customer] | } +role=${2:-technician} +case $role in technician|customer) ;; *) echo "role must be technician or customer" >&2; exit 2 ;; esac +case $src in https://*) ;; *) echo "only https:// URLs" >&2; exit 2 ;; esac + +tmp=$(mktemp -d) +trap 'rm -rf "$tmp"' EXIT + +case $src in + */q/*|*.zip|*.tar.gz) url=$src ;; # a custom app link (/q//mac) or a release file + *) + # latest.json: {"version":..,"platforms":{"darwin-universal":{"signature":..,"url":".."}}} + url=$(curl -fsSL "${src%/}/download/stable/$role/darwin-universal/latest.json" | tr -d '\n\r\t ' | + sed -n 's/.*"darwin-universal":{[^}]*"url":"\([^"]*\)".*/\1/p') + [ -n "$url" ] || { echo "no macOS release found at $src for $role" >&2; exit 1; } + ;; +esac + +echo "Downloading $url" +curl -fL --proto '=https' --tlsv1.2 -o "$tmp/pkg" "$url" +mkdir "$tmp/x" +if [ "$(head -c 2 "$tmp/pkg")" = "PK" ]; then ditto -x -k "$tmp/pkg" "$tmp/x"; else tar -xzf "$tmp/pkg" -C "$tmp/x"; fi + +app=$(find "$tmp/x" -maxdepth 1 -name '*.app' -type d | head -n 1) +[ -n "$app" ] || { echo "no .app in the download" >&2; exit 1; } +id=$(defaults read "$app/Contents/Info.plist" CFBundleIdentifier) +case $id in app.tether.desktop|net.tether.quick) ;; *) echo "unexpected bundle id: $id" >&2; exit 1 ;; esac +codesign --verify --deep --strict "$app" + +dest=/Applications +[ -w "$dest" ] || { dest="$HOME/Applications"; mkdir -p "$dest"; } +name=$(basename "$app") +pkill -x "$(defaults read "$app/Contents/Info.plist" CFBundleExecutable)" 2>/dev/null || true +rm -rf "${dest:?}/$name" +ditto "$app" "$dest/$name" +xattr -dr com.apple.quarantine "$dest/$name" 2>/dev/null || true # in case an older copy carried it +echo "Installed $dest/$name ($id)" +open "$dest/$name" diff --git a/scripts/make-macos-cert.sh b/scripts/make-macos-cert.sh new file mode 100644 index 0000000..6679bfa --- /dev/null +++ b/scripts/make-macos-cert.sh @@ -0,0 +1,57 @@ +#!/bin/sh +# Generate a free self-signed code-signing certificate for Tether's macOS builds (the counterpart of +# scripts/make-windows-cert.ps1 and the existing MACOS_SIGNING_P12 secret, see docs/macos.md). +# Self-signed is free and gives a stable code signature, so Screen Recording / Accessibility survive +# updates. It is not Apple-notarized (first start still needs the curl install or "Open Anyway"); +# a fully trusted, free Developer ID needs an organization fee waiver (docs/code-signing.md). +# +# sh scripts/make-macos-cert.sh ./secret +# +# Output (keep secret, never commit): tether-codesign.p12 -> CI secret MACOS_SIGNING_P12 (base64). +set -eu +out=${1:?usage: make-macos-cert.sh } +pw=${2:?p12 password required} +mkdir -p "$out" +key="$out/key.pem"; crt="$out/cert.pem"; p12="$out/tether-codesign.p12" + +openssl req -x509 -newkey rsa:3072 -keyout "$key" -out "$crt" -days 3650 -nodes \ + -subj "/CN=Tether Code Signing" \ + -addext "keyUsage=critical,digitalSignature" \ + -addext "extendedKeyUsage=critical,codeSigning" \ + -addext "basicConstraints=critical,CA:false" +# -legacy: the p12 RC2 format the macOS `security import` keychain accepts. +openssl pkcs12 -export -out "$p12" -inkey "$key" -in "$crt" -passout "pass:$pw" -legacy 2>/dev/null \ + || openssl pkcs12 -export -out "$p12" -inkey "$key" -in "$crt" -passout "pass:$pw" + +# Flawless one-double-click installer for customers: a configuration profile that installs and trusts +# the certificate (System Settings shows it, the user clicks Install). The native macOS way, no Terminal. +der=$(openssl x509 -in "$crt" -outform DER | base64 | tr -d '\n') +uid() { openssl rand -hex 16 | sed -E 's/(........)(....)(....)(....)(............)/\1-\2-\3-\4-\5/'; } +u1=$(uid); u2=$(uid) +cat > "$out/Trust Tether.mobileconfig" < + + + PayloadContent + + PayloadTypecom.apple.security.root + PayloadContent$der + PayloadIdentifiernet.tether.cert.$u2 + PayloadUUID$u2 + PayloadVersion1 + PayloadDisplayNameTether Code Signing + + PayloadDisplayNameTrust Tether + PayloadDescriptionTrusts Tether's code-signing certificate on this Mac. + PayloadIdentifiernet.tether.trust.$u1 + PayloadTypeConfiguration + PayloadUUID$u1 + PayloadVersion1 + +EOF +rm -f "$key" "$crt" + +echo "P12 : $p12 (secret -> MACOS_SIGNING_P12 = base64 -w0 of this; password -> MACOS_SIGNING_PASSWORD)" +echo "Installer : $out/Trust Tether.mobileconfig (hand to customers: double-click, Install in System Settings)" +echo "Note: codesign uses the p12 like today's cert (CI 'Import the code-signing certificate' step trusts it)." +echo " The profile trusts the signature; a browser download still needs 'Open Anyway' once unless notarized." diff --git a/scripts/make-windows-cert.ps1 b/scripts/make-windows-cert.ps1 new file mode 100644 index 0000000..b66ce25 --- /dev/null +++ b/scripts/make-windows-cert.ps1 @@ -0,0 +1,62 @@ +# Generate a free self-signed code-signing certificate for Tether's Windows builds, mirroring the +# macOS "Tether Code Signing" certificate (docs/code-signing.md). Self-signed is free and gives a +# stable publisher identity: on managed fleets IT deploys the public .cer to the Trusted Publishers +# store (GPO/Intune) and the apps are then fully trusted (no SmartScreen, no "Unknown publisher"), +# at no cost. On unmanaged machines it adds no trust by itself; pair it with the Mark-of-the-Web-free +# install on the download page, or move to the SignPath Foundation certificate once approved. +# +# pwsh scripts/make-windows-cert.ps1 -OutDir .\secret -Password +# +# Outputs (keep the .pfx and password secret; the .cer is public): +# tether-codesign.pfx signing key + cert -> CI secret WINDOWS_SIGNING_P12 (base64), never committed +# tether-codesign.cer public certificate -> ship to customers' IT for the trust store +param( + [string]$OutDir = (Join-Path (Get-Location) 'secret'), + [Parameter(Mandatory)][string]$Password, + [string]$Subject = 'CN=Tether Code Signing', + [int]$Years = 10 +) +$ErrorActionPreference = 'Stop' +New-Item -ItemType Directory -Force $OutDir | Out-Null + +# Code Signing EKU (1.3.6.1.5.5.7.3.3), exportable key, SHA-256. +$cert = New-SelfSignedCertificate -Type CodeSigningCert -Subject $Subject ` + -KeyUsage DigitalSignature -KeyExportPolicy Exportable -KeyLength 3072 -HashAlgorithm SHA256 ` + -NotAfter (Get-Date).AddYears($Years) -CertStoreLocation Cert:\CurrentUser\My ` + -TextExtension @('2.5.29.37={text}1.3.6.1.5.5.7.3.3') + +$pfx = Join-Path $OutDir 'tether-codesign.pfx' +$cer = Join-Path $OutDir 'tether-codesign.cer' +$cmd = Join-Path $OutDir 'Install Tether certificate.cmd' +$sec = ConvertTo-SecureString $Password -AsPlainText -Force +Export-PfxCertificate -Cert $cert -FilePath $pfx -Password $sec | Out-Null +Export-Certificate -Cert $cert -FilePath $cer | Out-Null + +# Flawless one-double-click installer for customers: a self-elevating .cmd with the public certificate +# embedded (PEM), installed machine-wide with the built-in certutil. No separate .cer, no network, no +# store picking. Root = trust the signer; TrustedPublisher = run the signed installer without a prompt. +$b64 = [Convert]::ToBase64String($cert.RawData) +$pem = for ($i = 0; $i -lt $b64.Length; $i += 64) { $b64.Substring($i, [Math]::Min(64, $b64.Length - $i)) } +$w = [Text.StringBuilder]::new() +[void]$w.AppendLine('@echo off') +[void]$w.AppendLine('rem Installs the Tether code-signing certificate so Windows trusts Tether. Double-click it.') +[void]$w.AppendLine('net session >nul 2>&1 || (powershell -NoProfile -Command "Start-Process -Verb RunAs -FilePath ''%~f0''" & exit /b)') +[void]$w.AppendLine('set "C=%TEMP%\tether-codesign.cer"') +[void]$w.AppendLine('>"%C%" echo -----BEGIN CERTIFICATE-----') +foreach ($l in $pem) { [void]$w.AppendLine(">>`"%C%`" echo $l") } +[void]$w.AppendLine('>>"%C%" echo -----END CERTIFICATE-----') +[void]$w.AppendLine('certutil -addstore -f Root "%C%" >nul && certutil -addstore -f TrustedPublisher "%C%" >nul && (echo Tether certificate installed.) || (echo Install FAILED.)') +[void]$w.AppendLine('del "%C%" >nul 2>&1') +[void]$w.AppendLine('echo.') +[void]$w.AppendLine('pause') +# ASCII, CRLF: a .cmd must be plain ANSI with Windows line endings. +[IO.File]::WriteAllText($cmd, ($w.ToString() -replace "`r?`n", "`r`n"), [Text.Encoding]::ASCII) + +# Keep the key only in the files, not in the user's store. +Remove-Item ("Cert:\CurrentUser\My\" + $cert.Thumbprint) -Force + +"Thumbprint : $($cert.Thumbprint)" +"Expires : $($cert.NotAfter.ToString('yyyy-MM-dd'))" +"PFX : $pfx (secret -> CI WINDOWS_SIGNING_P12 = base64 of this)" +"CER : $cer (public)" +"Installer : $cmd (hand to customers: double-click, confirm UAC, done)" diff --git a/scripts/trust-macos-cert.sh b/scripts/trust-macos-cert.sh new file mode 100644 index 0000000..fe3076c --- /dev/null +++ b/scripts/trust-macos-cert.sh @@ -0,0 +1,31 @@ +#!/bin/sh +# Install Tether's public code-signing certificate so macOS trusts its signed apps' signature: +# codesign validation passes and Screen Recording / Accessibility are stable. The .cer is public. +# +# # this user only (no sudo): +# curl -fsSL https:///download/trust-macos-cert.sh | sh -s -- https:// +# # all users (asks for your password once): +# curl -fsSL https:///download/trust-macos-cert.sh | sh -s -- https:// --machine +# +# Note: a self-signed certificate is not an Apple Developer ID, so Gatekeeper still shows "Open Anyway" +# once for an app downloaded in a browser. The curl install (scripts/install-macos.sh) avoids that +# entirely (curl sets no quarantine), so for a no-prompt install use that; this trust step keeps the +# signature recognised across updates. For zero prompts on any Mac you need notarization (docs/code-signing.md). +set -eu +src=${1:?usage: trust-macos-cert.sh https:// [--machine] | [--machine]} +machine=${2:-} +case $src in + https://*) cer=$(mktemp); curl -fsSL "${src%/}/download/tether-codesign-macos.cer" -o "$cer" ;; + *) cer=$src ;; +esac +# Confirm it is the right certificate and public (no private key). +subj=$(openssl x509 -in "$cer" -inform DER -noout -subject 2>/dev/null || openssl x509 -in "$cer" -noout -subject) +case $subj in *"Tether Code Signing"*) ;; *) echo "unexpected certificate: $subj" >&2; exit 1 ;; esac + +if [ "$machine" = "--machine" ]; then + sudo security add-trusted-cert -d -r trustAsRoot -p codeSign -k /Library/Keychains/System.keychain "$cer" + echo "Installed 'Tether Code Signing' for all users (System keychain, code signing)." +else + security add-trusted-cert -r trustAsRoot -p codeSign -k "$HOME/Library/Keychains/login.keychain-db" "$cer" + echo "Installed 'Tether Code Signing' for your account (login keychain, code signing)." +fi diff --git a/scripts/trust-windows-cert.ps1 b/scripts/trust-windows-cert.ps1 new file mode 100644 index 0000000..a924117 --- /dev/null +++ b/scripts/trust-windows-cert.ps1 @@ -0,0 +1,31 @@ +# Install Tether's public code-signing certificate so its signed apps are trusted on this PC: +# no SmartScreen "Unknown publisher", no warning. Run once per machine (or deploy the .cer by +# GPO/Intune to a fleet). The .cer is public; it contains no private key. +# +# # current user only (no admin): +# powershell -NoProfile -Command "irm https:///download/trust-windows-cert.ps1 | iex" +# # all users (run the PowerShell window as Administrator), pass the relay: +# powershell -NoProfile -ExecutionPolicy Bypass -File scripts\trust-windows-cert.ps1 -Server https:// -Machine +# +# -Cer takes a local .cer instead of downloading; -Server downloads /download/tether-codesign.cer. +param( + [string]$Server, + [string]$Cer, + [switch]$Machine +) +$ErrorActionPreference = 'Stop' +if (-not $Cer) { + if (-not $Server) { throw 'Give -Server https:// or -Cer ' } + $Cer = Join-Path $env:TEMP 'tether-codesign.cer' + Invoke-WebRequest "$($Server.TrimEnd('/'))/download/tether-codesign.cer" -OutFile $Cer -UseBasicParsing +} +$c = [System.Security.Cryptography.X509Certificates.X509Certificate2]::new($Cer) +if ($c.Subject -ne 'CN=Tether Code Signing') { throw "unexpected certificate: $($c.Subject)" } +if ($c.HasPrivateKey) { throw 'refusing: this file contains a private key; install only the public .cer' } + +$loc = if ($Machine) { 'LocalMachine' } else { 'CurrentUser' } # LocalMachine needs Administrator +foreach ($store in 'Root', 'TrustedPublisher') { # Root = trust the signer; TrustedPublisher = run without prompt + Import-Certificate -FilePath $Cer -CertStoreLocation "Cert:\$loc\$store" | Out-Null +} +"Installed 'Tether Code Signing' (thumbprint $($c.Thumbprint)) into $loc Root + TrustedPublisher." +"Tether's signed installers are now trusted for $(if ($Machine) {'all users'} else {'your account'}) on this PC."