Skip to content

Commit

Permalink
Restore MSIX signing and ensure expired certificates are not selected (
Browse files Browse the repository at this point in the history
…GH-30649)

Reverts the change in d6c6e6b and applies a better fix.
  • Loading branch information
zooba committed Jan 17, 2022
1 parent 596cf51 commit 9e20ec4
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 4 deletions.
8 changes: 5 additions & 3 deletions .azure-pipelines/windows-release/stage-pack-msix.yml
Expand Up @@ -96,9 +96,7 @@ jobs:
displayName: Sign side-loadable MSIX bundles
dependsOn:
- Pack_MSIX
# Our current certificate does not support MSIX signing, so we unconditionally skip this step
#condition: and(succeeded(), variables['SigningCertificate'])
condition: false
condition: and(succeeded(), variables['SigningCertificate'])

pool:
name: 'Windows Release'
Expand All @@ -123,6 +121,10 @@ jobs:
downloadPath: $(Build.BinariesDirectory)

# MSIX must be signed and timestamped simultaneously
#
# Getting "Error: SignerSign() failed." (-2147024885/0x8007000b)"?
# It may be that the certificate info collected in stage-sign.yml is wrong. Check that
# you do not have multiple matches for the certificate name you have specified.
- powershell: |
$failed = $true
foreach ($retry in 1..3) {
Expand Down
2 changes: 1 addition & 1 deletion .azure-pipelines/windows-release/stage-sign.yml
Expand Up @@ -91,7 +91,7 @@ jobs:
- powershell: |
$m = 'CN=$(SigningCertificate)'
$c = ((gci Cert:\CurrentUser\My), (gci Cert:\LocalMachine\My)) | %{ $_ } | `
?{ $_.Subject -match $m } | `
?{ $_.Subject -match $m -and $_.NotBefore -lt (Get-Date) -and $_.NotAfter -gt (Get-Date) } | `
select -First 1
if (-not $c) {
Write-Host "Failed to find certificate for $(SigningCertificate)"
Expand Down

0 comments on commit 9e20ec4

Please sign in to comment.