【问题标题】:Driver signing: how to get MakeCert test certificates to work on x64驱动程序签名:如何让 MakeCert 测试证书在 x64 上工作
【发布时间】:2023-03-23 11:40:01
【问题描述】:

我正在尝试加载已使用 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

当我按照 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


    【解决方案1】:

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

    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 模式关闭,则自签名证书不会被内核信任的任何东西交叉签名,因此它被视为无效,因此安装证书无济于事。

    我很乐意接受更正。

    【讨论】:

    • 这就是M$应该死的原因。它们必须是您的根 CA,就像您的 CA 永远不够好。
    猜你喜欢
    • 2011-08-07
    • 2013-01-08
    • 2013-08-13
    • 2023-03-19
    • 2013-04-21
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2016-01-11
    相关资源
    最近更新 更多