【问题标题】:How does one correctly dual-sign code with a timestamp?如何正确地对带有时间戳的代码进行双重签名?
【发布时间】:2014-01-03 07:00:40
【问题描述】:

我有两个代码签名证书(一个 SHA-1,一个 SHA-256),我想将它们应用于同一个文件。我尝试附加 SHA-256 证书,但失败了:

:: Signs with the SHA-1 certificate
signtool sign /sha1 8f52fa9db30525dfabb35b08bd1966693a30eccf /t http://timestamp.verisign.com/scripts/timestamp.dll my_app_here.exe
:: Signs with the SHA-2 certificate
signtool sign /sha1 8b0026ecbe5bf245993b26e164f02e1313579e47 /as /t http://timestamp.verisign.com/scripts/timestamp.dll my_app_here.exe

这失败并出现错误:

Done Adding Additional Store
SignTool Error: SignedCode::Sign returned error: 0x80070057
        The parameter is incorrect.
SignTool Error: An error occurred while attempting to sign: my_app_here.exe

如果我从第二个命令中删除时间戳 URL,则签名成功完成,但 SHA-2 签名没有时间戳。 (无论我是否在第一个签名上加上时间戳都没有影响)

此处的目的是允许某人在支持此功能的操作系统上使用更强的证书验证应用,但避免在不支持更强证书的操作系统(Vista、XP)上验证失败.

这种事情有可能吗?

【问题讨论】:

  • 嗯,很高兴知道我并不孤单需要这个......
  • 您是否尝试过/td sha256 /tr ... 而不是/t ... 进行第二次签名?

标签: code-signing code-signing-certificate authenticode verisign


【解决方案1】:

SHA-2 Authenticode 签名需要 RFC 3161 时间戳服务器。 timestamp.verisign.com URL 不适用于此。

Symantec/Verisign 的 RFC 3161 URL 是:

http://sha256timestamp.ws.symantec.com/sha256/timestamp

如果您仍在使用较旧的http://timestamp.geotrust.com/tsa URL,但它失败了(2017 年 4 月),您应该将其更新为上述 URL。 GeoTrust 与 Verisign 一样,现在是 Symantec 的一部分。

来源:

https://knowledge.verisign.com/support/code-signing-support/index?page=content&id=SO5820

【讨论】:

  • 感谢您解释“为什么它不起作用”,我读过的其他答案错过了那部分。要使其正常工作,只需将 /t http://timestamp.verisign.com/scripts/timestamp.dll 替换为 /tr http://timestamp.geotrust.com/tsa
  • GeoTrust 服务器仍然使用 SHA1 摘要作为时间戳,更糟糕的是,它们的证书链以带有 MD5 摘要的根证书终止。如果您想要时间戳的 SHA256 摘要,请使用 timestamp.globalsign.com/?signature=sha2 作为 URL(指定 /td SHA256 也无妨)。
  • 带有 RFC 3161 时间戳 URL 的 SHA-256 是 sha256timestamp.ws.symantec.com/sha256/timestamp
猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 2014-05-19
  • 1970-01-01
  • 2015-08-17
  • 2011-05-23
  • 2014-04-21
  • 2020-09-07
相关资源
最近更新 更多