Skip to content

Commit d3246af

Browse files
Merge ae929cd into dff28c7
2 parents dff28c7 + ae929cd commit d3246af

11 files changed

Lines changed: 72 additions & 27 deletions

File tree

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,3 +51,4 @@ source/locale/*/cldr.dic
5151
.venv
5252
nvdaHelper/docs/
5353
*.pfx
54+
appveyor-tools/

appveyor.yml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,8 +15,13 @@ branches:
1515

1616
environment:
1717
PY_PYTHON: 3.11-32
18+
# TODO: remove key
1819
secure_authenticode_pass:
1920
secure: Way+hJyhbiLG/cmCo4+dHHzS5DiSvk/45o6frnIQ27GBX6nVDsh7jwQ7fSnqxBRP
21+
# TODO use appveyor encrypt YAML to change this from test cert to prod cert
22+
apiSigningToken:
23+
secure: pTgq98Ewdmg+NgPNoaskkeG6UoPNw1BvIKPAHP/v1PqvD7ihPaVc0TbvZ3qpTgRE
24+
# TODO: check where this is used and remove key
2025
secure_ssh_pass:
2126
secure: Iql/RhSathGacONacsyr6gis+rjL75UFZ/R+nPAJpo3asAzQSQQd8hfxq0iv8+Th
2227
mozillaSymsAuthToken:

appveyor/scripts/decryptFilesForSigning.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,11 @@
1+
# TODO update this for apiSigningToken - is any of this still required?
12
if(!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_signing) {
23
openssl enc -d -md sha256 -aes-256-cbc -pbkdf2 -salt -pass pass:$env:secure_authenticode_pass -in appveyor\authenticode.pfx.enc -out appveyor\authenticode.pfx
34
if($LastExitCode -ne 0) {
45
$errorCode=$LastExitCode
56
Add-AppveyorMessage "Unable to decrypt authenticode certificate"
67
}
8+
# TODO why was a ssh key used?
79
openssl enc -d -md sha256 -aes-256-cbc -pbkdf2 -salt -pass pass:$env:secure_ssh_pass -in appveyor\ssh_id_rsa.enc -out appveyor\ssh_id_rsa
810
if($LastExitCode -ne 0) {
911
$errorCode=$LastExitCode

appveyor/scripts/setSconsArgs.ps1

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,9 @@ if ($env:versionType) {
1212
}
1313
$sconsArgs += " publisher=`"$env:scons_publisher`""
1414
if (!$env:APPVEYOR_PULL_REQUEST_NUMBER -and $env:feature_signing) {
15-
$sconsArgs += " certFile=appveyor\authenticode.pfx certTimestampServer=http://timestamp.digicert.com"
15+
# TODO make sure this doesn't expose the decrypted API key in the appveyor log
16+
# TODO Is this script run in local builds? if so we need to add back the certFile and certPassword since people still need to be able to make self-signed builds.
17+
$sconsArgs += " apiSigningToken=$env:apiSigningToken"
1618
}
1719
$sconsArgs += " version_build=$env:APPVEYOR_BUILD_NUMBER"
1820
# We use cmd to run scons because PowerShell throws exceptions if warnings get dumped to stderr.

appveyor/scripts/sign.ps1

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,18 @@
1+
# A part of NonVisual Desktop Access (NVDA)
2+
# Copyright (C) 2010-2024 NV Access Limited
3+
# This file may be used under the terms of the GNU General Public License, version 2 or later.
4+
# For more details see: https://www.gnu.org/licenses/gpl-2.0.html
5+
6+
param(
7+
[string]$ApiToken,
8+
[string]$FileToSign
9+
)
10+
11+
# Check if the Submit-SigningRequest command is available
12+
if (-not (Get-Command -Name Submit-SigningRequest -ErrorAction SilentlyContinue)) {
13+
# If the command is not available, install the SignPath module
14+
Install-Module -Name SignPath -Scope CurrentUser -Force
15+
}
16+
17+
# Execute Submit-SigningRequest command from the SignPath module
18+
Submit-SigningRequest -ApiToken $ApiToken -InputArtifactPath $FileToSign -OutputArtifactPath $FileToSign -OrganizationId "12147e94-bba9-4fef-b29b-300398e90c5a" -ProjectSlug "NVDA" -SigningPolicySlug "test_signing_policy" -WaitForCompletion -Force

appx/sconscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ else: # not for submission, just side-loadable
5858
packagePublisherDisplayName=env['publisher']
5959
productName="NVDA Screen Reader (Windows Desktop Bridge Edition)"
6060

61-
signExec=env['signExec'] if env['certFile'] else None
61+
signExec=env['signExec'] if (bool(env['certFile']) ^ bool(env['apiSigningToken'])) else None
6262

6363
# Files from NVDA's distribution that cannot be included in the appx due to policy or security restrictions
6464
excludedDistFiles = [

nvdaHelper/archBuild_sconscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ if not env.get('MSVC_VERSION') or tuple(map(int, env.get('MSVC_VERSION').split("
7070
TARGET_ARCH=env['TARGET_ARCH']
7171
debug=env['nvdaHelperDebugFlags']
7272
release=env['release']
73-
signExec=env['signExec'] if env['certFile'] else None
73+
signExec=env['signExec'] if (bool(env['certFile']) ^ bool(env['apiSigningToken'])) else None
7474

7575
#Some defines and includes for the environment
7676
env.Append(

nvdaHelper/liblouis/sconscript

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ louisSourceDir = louisRootDir.Dir("liblouis")
3333
louisTableDir = louisRootDir.Dir("tables")
3434
outDir = sourceDir.Dir("louis")
3535
unitTestTablesDir = env.Dir("#tests/unit/brailleTables")
36-
signExec=env['signExec'] if env['certFile'] else None
36+
signExec=env['signExec'] if (bool(env['certFile']) ^ bool(env['apiSigningToken'])) else None
3737

3838
RE_AC_INIT = re.compile(r"^AC_INIT\(\[(?P<package>.*)\], \[(?P<version>.*)\], \[(?P<bugReport>.*)\], \[(?P<tarName>.*)\], \[(?P<url>.*)\]\)")
3939
def getLouisVersion():

projectDocs/dev/buildingNVDA.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ This is useful when [creating a self signed build](./selfSignedBuild.md).
7676
* This enables various C++ compiler optimizations such as /O2 and whole-program optimization.
7777
* It also instructs Python to generate optimized byte code.
7878
* publisher: The publisher of this build.
79+
# TODO update documentation for apiSigningToken
7980
* certFile: The certificate file with which to sign executables. The certificate must be in pfx format and contain the private key.
8081
* certPassword: The password for the private key in the signing certificate. If omitted, no password will be assumed.
8182
* certTimestampServer: The URL of the timestamping server to use to timestamp authenticode signatures. If omitted, signatures will not be timestamped.

projectDocs/dev/selfSignedBuild.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -75,12 +75,14 @@ On any supported version of Windows, you can manage certifications through the "
7575

7676
### Using the certificate
7777

78+
# TODO update for apiSigningToken
7879
When running a scons command, append `certFile=local.pfx certPassword=<Password>`.
7980

8081
#### Example: building a self-signed installer
8182

8283
From Command Prompt in your NVDA source directory:
8384
```cmd
85+
# TODO update for apiSigningToken - remember people still need to be able to make self-signed builds
8486
scons launcher certFile=local.pfx certPassword=<Password>
8587
```
8688

0 commit comments

Comments
 (0)