11

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

这种事情甚至有可能吗?

+0

好,很高兴知道我并不孤单,我需要这个...... – vcsjones

+0

你尝试'/ TD SHA256/TR ...',而不是'/吨......第二个签名? –

回答

12

SHA-2 Authenticode签名需要RFC 3161时间戳服务器。 timestamp.verisign.com网址对此不起作用。

的RFC 3161 URL赛门铁克/ VeriSign是:

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

如果你还在使用旧http://timestamp.geotrust.com/tsa URL,它是失败的(2017年4月),你应该将其更新到上述一个。像Verisign一样,GeoTrust现在是赛门铁克的一部分。

来源:

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

+0

谢谢你解释“为什么它不起作用”,我读过的其他答案错过了那部分。为了使它工作,只需用'/ tr http:// timestamp.geotrust.com/tsa'替换'/ t http:// timestamp.verisign.com/scripts/timestamp.dll'。 –

+1

GeoTrust服务器仍然使用SHA1摘要作为时间戳,更糟糕的是,它们的证书链终止于具有MD5摘要的根证书。如果你想SHA256摘要的时间戳使用http://timestamp.globalsign.com/?signature=sha2作为URL(指定/ td SHA256也不会伤害)。 –

+4

带有RFC 3161时间戳URL的SHA-256是http://sha256timestamp.ws.symantec.com/sha256/timestamp –

相关问题