12

我有两个代码签名证书(一个 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)上验证失败。

这种事情甚至可能吗?

4

1 回答 1

12

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 一样,现在是赛门铁克的一部分。

来源:

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

于 2014-12-07T03:37:48.593 回答