【问题标题】:How to list all signatures with signtool.exe while verifying against the kernel signing policy如何在验证内核签名策略时使用 signtool.exe 列出所有签名
【发布时间】:2016-01-11 22:15:11
【问题描述】:

所以我正在使用 Windows SDK 8.1 中的 signtool 对二进制文件进行签名:

"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" sign /a /i Symantec /ac C:\utils\MSCV-VSClass3.cer /ph /t "http://timestamp.verisign.com/scripts/timstamp.dll" "foo.exe"
Done Adding Additional Store
Successfully signed: foo.exe
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" sign /a /i Symantec /ac C:\utils\MSCV-VSClass3.cer /ph /fd sha256 /tr "http://timestamp.geotrust.com/tsa" /td sha256 /as "foo.exe"
Done Adding Additional Store
Successfully signed: foo.exe

当我在文件属性中查看时,我可以看到正确的结果。

但是,当我将 verifysigntool 一起使用时,我得到的结果取决于传递的参数:

"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" verify /all "foo.exe"
File: foo.exe
Index  Algorithm  Timestamp
========================================
SignTool Error: A certificate chain processed, but terminated in a root
        certificate which is not trusted by the trust provider.
SignTool Error: A certificate chain processed, but terminated in a root
        certificate which is not trusted by the trust provider.

使用/pa/pa /all 我可以看到两个时间戳:

"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" verify /pa "foo.exe"
File: foo.exe
Index  Algorithm  Timestamp
========================================
0      sha1       Authenticode

Successfully verified: foo.exe
"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" verify /pa /all "foo.exe"
File: foo.exe
Index  Algorithm  Timestamp
========================================
0      sha1       Authenticode
1      sha256     RFC3161

但是当尝试使用/kp 来验证内核签名策略时,signtool 拒绝与/all 一起运行:

"C:\Program Files (x86)\Windows Kits\8.1\bin\x64\signtool.exe" verify /kp /all "foo.exe"
SignTool Error: The /all option is incompatible with the /kp option.

所以我有两个问题:

  1. 这是一个缺陷吗(/kp/all 不能一起工作)?
  2. 有没有比两次调用signtool verify 更好的方法,一次使用/pa /all,一次使用/kp查看所有时间戳验证内核签署政策?

【问题讨论】:

    标签: windows code-signing signtool authenticode


    【解决方案1】:

    我最近偶然发现了与/kp/all 相同的问题,并且完全偶然地发现参数的顺序很重要。如果我指定/kp /all,我会得到The /all option is incompatible with the /kp option。但是如果我通过了/all /kp,验证就会顺利进行:它会枚举文件中的所有签名并全部检查。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2016-03-30
      • 2020-06-11
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2022-06-24
      相关资源
      最近更新 更多