-
Notifications
You must be signed in to change notification settings - Fork 8.4k
Set-AuthenticodeSignature does not support https timestamp server #25130
Copy link
Copy link
Closed
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-ExternalThe issue is caused by external component(s).The issue is caused by external component(s).WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendationWG-Securitysecurity related areas such as JEAsecurity related areas such as JEA
Metadata
Metadata
Assignees
Labels
Needs-TriageThe issue is new and needs to be triaged by a work group.The issue is new and needs to be triaged by a work group.Resolution-ExternalThe issue is caused by external component(s).The issue is caused by external component(s).WG-Cmdletsgeneral cmdlet issuesgeneral cmdlet issuesWG-ReviewedA Working Group has reviewed this and made a recommendationA Working Group has reviewed this and made a recommendationWG-Securitysecurity related areas such as JEAsecurity related areas such as JEA
Type
Fields
Give feedbackNo fields configured for issues without a type.
Prerequisites
Steps to reproduce
The Set-AuthenticodeSignature command allows the use of an http or https timestamp server, however, the internal function (CryptUIWizDigitalSign) it relies on does not support https timestamp server.
An internal function in cryptuiwizard!CryptUIWizDigitalSign (MSSIGN32!CHttpTran::Open) will return an Invalid Parameter error if the URL doesn’t start with http. This makes any https URL fail.
If you run Set-AuthenticodeSignature with an https timestamp server, the returned status is The parameter is incorrect
Reproduction steps:
$cert = New-SelfSignedCertificate -KeyUsage DigitalSignature -KeySpec Signature -KeyAlgorithm RSA -KeyLength 2048 -DNSName “www.yourdomain.com” -CertStoreLocation Cert:\CurrentUser\My -Type CodeSigningCert -Subject "CodeSign1"
$SignatureParams2 = @{
FilePath = "test.ps1"
Certificate = $cert
IncludeChain = "All"
TimestampServer = "https://frc3161.ai.moda/microsoft"
}
Set-AuthenticodeSignature @SignatureParams2
Expected behavior
Set-AuthenticodeSignature should not allow an https timestamp server.Actual behavior
Set-AuthenticodeSignature is allowing an https timestamp server and the command fails when calling the internal function CryptUIWizDigitalSign (part of Windows API cryptUI.dll).Error details
Environment data
Visuals
The following PR needs to be rolled back:
#16134