【发布时间】:2023-03-23 11:40:01
【问题描述】:
我正在尝试加载已使用 MakeCert.exe 生成的证书签名的内核驱动程序。
我按照 Windows Driver Kit 文档中的说明进行操作:
- Sign the driver with MakeCert.exe
-
Verify the signature with
SignTool verify /v /pa DriverFileName.sys。 - Installing the cert into the test computer's Trusted Root Certification Authorities store and Trusted Publishers store,使用CertMgr.exe
当我按照 WDK Microsoft Docs 中的说明使用 SignTool verify /v /pa DriverFileName.sys 验证签名时,SignTool 报告签名正常。我已经在开发计算机和应该加载驱动程序的测试机器上完成了这项工作。
但是,驱动程序实际上并没有加载。 Windows CodeIntegrity 日志显示3004: Windows is unable to verify the image integrity of the file \Device\HarddiskVolume3\path\DriverFileName.sys because file hash could not be found on the system. A recent hardware or software change might have installed a file that is signed incorrectly or damaged, or that might be malicious software from an unknown source.
我看了this similar question。当我运行SignTool verify /v /kp DriverFileName.sys 时,我得到了与该问题相同的结果。它说:SignTool Error: Signing Cert does not chain to a Microsoft Root Cert.
链接问题的解决方案涉及使用真实的、非测试证书,并更改签名设置以使其正确链接到 Microsoft 根证书。我还没有到那个阶段;我只想让我的测试基础设施“正常”工作。
我有兴趣让内核加载我的驱动程序,并使用我在测试机器上手动安装的证书验证签名。我知道我可以使用 bcdedit -set testsigning yes 完全禁用签名验证,但这似乎有点过头了 - 它允许 any 签名的驱动程序运行,即使它没有使用我的测试证书签名安装在机器上。是否可以关闭“测试签名”模式(因此驱动程序签名实际上仍然验证已安装的证书),但仍使用我内部自行生成的 MakeCert.exe 测试证书?
【问题讨论】:
标签: windows 64-bit makecert driver-signing