驱动程序签名:如何使MakeCert测试证书在x64上运行

时间:2018-02-09 08:42:59

标签: windows 64-bit makecert driver-signing

我正在尝试加载已使用MakeCert.exe生成的证书签名的内核驱动程序。

我按照Windows Driver Kit文档中的说明进行操作:

  1. Sign the driver with MakeCert.exe
  2. Verify the signature with SignTool verify /v /pa DriverFileName.sys
  3. Installing the cert into the test computer's Trusted Root Certification Authorities store and Trusted Publishers store,使用CertMgr.exe
  4. 当我使用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完全禁用签名验证,但这似乎有点过分 - 它将允许任何签名的驱动程序运行,即使它没有与测试签名证书我已安装在机器上。是否可以离开" testsigning"模式已关闭(因此驱动程序签名仍然针对已安装的证书进行了验证),但仍使用我自己生成的内部MakeCert.exe测试证书?

1 个答案:

答案 0 :(得分:0)

看起来答案是否定的,但这是不可能的。

Can I install self-signed drivers on 64-bit Windows without test mode if the self-signed CA root certificate is imported to the machine store?

WDK文档似乎颇具误导性。在x64测试机器上安装由MakeCert.exe生成的证书似乎完全没有意义,因为内核从不关注它。

如果启用了TESTSIGNING模式,则签名未经过验证,因此无需安装证书。

如果TESTSIGNING模式关闭,则自签名证书不会被内核信任的任何内容交叉签名,因此它不被视为有效,因此安装证书并不起作用。 / p>

我很高兴接受更正。