【发布时间】:2018-05-17 16:47:48
【问题描述】:
我签名的驱动程序生成的 Windows(带有 SHA256 修补程序的 Windows 7)无法启动并生成错误代码 0xC0000428(Windows 无法验证此文件的数字签名)。
我接手了一个使用 Visual Studio 2010 创建的驱动程序项目,我的首要任务是更新过期的代码签名证书。最初数字证书使用 Global Sign,现在使用 Digi Cert。最初的程序员在给我的一封电子邮件中说,他每年都在这个话题上遇到麻烦。
我检查了工作但已过期的icsflt.sys 驱动程序文件,发现它是 SHA256,指纹为 SHA1。其他一切都有效。我尝试了许多不同的变体(双签名证书、SHA1 和 SHA2)。我的最后一次尝试,直接来自 Digi Cert 技术支持,使用以下命令行。
C:\ICS\IM6000\Certificate>"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" sign /tr http://timestamp.digicert.com /td sha256 /fd sha256 /a "C:\ICS\IM6000\filter\objfre_win7_AMD64\amd64\icsflt.sys"
Done Adding Additional Store
Successfully signed: C:\ICS\IM6000\filter\objfre_win7_AMD64\amd64\icsflt.sys
这是证书,看起来和原来的很像。
这是清晰显示摘要算法的 SHA256 的基本证书。证书来自构建机器。 “Windows Boot Manager”的第一张截图来自测试机。
以下是我在 Digi Certs 网站上使用的一些链接。
Sign Code SignTool.exe Command Line
Installing Code Signing Certificate
这是有效的过期证书视图。
这是良好/工作驱动程序的驱动程序属性数字签名。
您可以将它们区分开来,因为我将好的/工作的那一个重命名为 icflt-good.sys。除了公司名称、日期和证书颁发机构 (CA) 之外,两者看起来相同,但 Windows 7 使用来自 Digi Cert 的新证书。
这是前面signtool.exe 命令行的代码,我注释掉了。
@echo on
@REM see "How to Release-Sign a Driver Package" and "Release-Signing a Driver through an Embedded Signature in Windows DDK"
@REM despite the store's name seems to be Personal we should use MY when using Signtool. Otherwise the certificate is not found.
@REM when Personal store is created with makecert, another Personal is created. Weird.
@REM Signtool sign /v /ac MSCV-GlobalSign.cer /s MY /sha1 5250f1a5ddd11e3e4e924757e6da1c43dd3487c0 /t http://timestamp.globalsign.com/scripts/timstamp.dll %mydriverpath%
@REM Signtool sign /v /ac MSCV-GlobalSign.cer /s MY /sha1 5D743B02DCDE74B16D133BDFEB2E1C5F6F44E966 /t http://timestamp.globalsign.com/scripts/timstamp.dll %mydriverpath%
@REM check $\IM6000\Certificate\current for the exact file names and password
@REM Signtool sign /v /ac %PROJECT_DIR%\..\Certificate\current\MSCV-GlobalSign.cer /f %PROJECT_DIR%\..\Certificate\current\OS201602156091.pfx /p 1C73295775925A7EE1C6D35ADF9DF611A55A60B8 /t http://timestamp.globalsign.com/scripts/timstamp.dll %mydriverpath%
@REM Signtool sign /v /ac %PROJECT_DIR%\..\Certificate\current\GlobalSignRootCA.crt /f %PROJECT_DIR%\..\Certificate\current\OS201701106786.pfx /p ICScertificate2017 /t http://timestamp.globalsign.com/scripts/timstamp.dll %mydriverpath%
@REM Signtool sign /v /fd sha256 /ac %PROJECT_DIR%\..\Certificate\current\GlobalSignRootCA.crt /f %PROJECT_DIR%\..\Certificate\current\OS201701106786.pfx /p ICScertificate2017 /tr http://timestamp.globalsign.com/scripts/timstamp.dll?td=sha256 /td sha256 %mydriverpath%
【问题讨论】:
标签: windows visual-studio code-signing device-driver signtool