mirror of
https://github.com/python/cpython.git
synced 2025-11-02 11:08:57 +00:00
Allow Windows layout builds to fully skip code signing (GH-12808)
This commit is contained in:
parent
f4e5661e85
commit
606c66a17f
2 changed files with 8 additions and 3 deletions
|
|
@ -16,6 +16,7 @@
|
||||||
#>
|
#>
|
||||||
param(
|
param(
|
||||||
[Parameter(Mandatory=$true)][string]$catalog,
|
[Parameter(Mandatory=$true)][string]$catalog,
|
||||||
|
[switch]$sign,
|
||||||
[string]$description,
|
[string]$description,
|
||||||
[string]$certname,
|
[string]$certname,
|
||||||
[string]$certsha1,
|
[string]$certsha1,
|
||||||
|
|
@ -31,4 +32,6 @@ MakeCat $catalog
|
||||||
if (-not $?) {
|
if (-not $?) {
|
||||||
throw "Catalog compilation failed"
|
throw "Catalog compilation failed"
|
||||||
}
|
}
|
||||||
Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
|
if ($sign) {
|
||||||
|
Sign-File -certname $certname -certsha1 $certsha1 -certfile $certfile -description $description -files @($catalog -replace 'cdf$', 'cat')
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -31,6 +31,10 @@ function Sign-File {
|
||||||
$certfile = $env:SigningCertificateFile;
|
$certfile = $env:SigningCertificateFile;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
if (-not ($certsha1 -or $certname -or $certfile)) {
|
||||||
|
throw "No signing certificate specified"
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($a in $files) {
|
foreach ($a in $files) {
|
||||||
if ($certsha1) {
|
if ($certsha1) {
|
||||||
SignTool sign /sha1 $certsha1 /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
SignTool sign /sha1 $certsha1 /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
||||||
|
|
@ -38,8 +42,6 @@ function Sign-File {
|
||||||
SignTool sign /a /n $certname /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
SignTool sign /a /n $certname /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
||||||
} elseif ($certfile) {
|
} elseif ($certfile) {
|
||||||
SignTool sign /f $certfile /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
SignTool sign /f $certfile /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
||||||
} else {
|
|
||||||
SignTool sign /a /fd sha256 /t http://timestamp.verisign.com/scripts/timestamp.dll /d $description $a
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue