Ste*_*lly 105 timestamp code-signing
我们为所有生产版本执行代码签名和时间戳.偶尔(通常在我们即将进行RTM(!)时)Verisign的时间戳服务器(" http://timestamp.verisign.com/scripts/timstamp.dll ")决定间歇性地脱机.
在这种情况下我们该怎么做?
flo*_*dob 83
我使用以下批处理文件,最多循环300次.有两个参数,%1是包含批处理文件,pfx文件和signtool.exe的文件夹的路径.%2是要签名的文件的完整路径.您可以在visual studio post build事件中调用此方法,例如调用"$(SolutionDir)thirdparty\signing\sign.bat""$(SolutionDir)thirdparty\signing""$(TargetPath)"我已将此批处理文件修改为在每次迭代中使用不同的时间戳服务器.目前它使用Comodo,Verisign,GlobalSign和Starfield.希望这是终极签名脚本;)
@echo off
REM create an array of timestamp servers...
set SERVERLIST=(http://timestamp.comodoca.com/authenticode http://timestamp.verisign.com/scripts/timestamp.dll http://timestamp.globalsign.com/scripts/timestamp.dll http://tsa.starfieldtech.com)
REM sign the file...
%1\signtool.exe sign /f %1\comodo.pfx /p videodigital %2
set timestampErrors=0
for /L %%a in (1,1,300) do (
for %%s in %SERVERLIST% do (
REM try to timestamp the file. This operation is unreliable and may need to be repeated...
%1\signtool.exe timestamp /t %%s %2
REM check the return value of the timestamping operation and retry a max of ten times...
if ERRORLEVEL 0 if not ERRORLEVEL 1 GOTO succeeded
echo Signing failed. Probably cannot find the timestamp server at %%s
set /a timestampErrors+=1
)
REM wait 2 seconds...
choice /N /T:2 /D:Y >NUL
)
REM return an error code...
echo sign.bat exit code is 1. There were %timestampErrors% timestamping errors.
exit /b 1
:succeeded
REM return a successful code...
echo sign.bat exit code is 0. There were %timestampErrors% timestamping errors.
exit /b 0
Run Code Online (Sandbox Code Playgroud)
我还将http://timestamp.comodoca.com放入可信站点(感谢Vince).我认为这可能是重要的一步.我也更新了PC上的根证书.
gre*_*mac 15
我不确定时间戳服务器是否必须由根CA拥有.
我们使用http://timestamp.comodoca.com/authenticode(并且有一个Comodo authenticode证书),但实际上有一个类似的问题,因为他们的服务器似乎偶尔会给出错误或超时.我们在持续集成服务器上进行夜间(或按需)构建的一部分,仅用于发布版本(不适用于调试版本).
我(主要)以两种方式解决了这个问题:
在这些之间,由时间戳服务器问题引起的构建失败已经从一周一次或两次变为几乎从不.
编辑:我有一个MSBuild任务执行此操作(以及读取存储库外存储的证书密码),地址是https://gist.github.com/gregmac/4cfacea5aaf702365724
Dav*_*vid 12
它通过以下其中一个替换verisign时间戳url很好地工作:
http://timestamp.comodoca.com/authenticode
http://www.trustcenter.de/codesigning/timestamp
Ric*_*Web 11
您通常可以使用任何您想要的时间戳服务。尽管大多数 CA 将提供时间戳服务。例子
http://timestamp.globalsign.com/scripts/timstamp.dll
http://timestamp.comodoca.com/authenticode
http://www.startssl.com/timestamp
http://timestamp.digicert.com?alg=sha1
http://timestamp.digicert.com?alg=sha256
Run Code Online (Sandbox Code Playgroud)
timestamp.verisign.com 于 2019 年后端正式 EOL,有关更多信息,请参阅我对以下问题的回答。
http-timestamp-verisign-com-scripts-timstamp-dll-not-available
VeriSign时间戳服务是免费的.这可能也许是为什么它的可靠性不够充分; 他们不给它一个维护预算!
绝对这是一个大问题.由于代码时间戳失败构建失败而浪费的时间是整个软件开发行业日益严重的问题.当然,你可以写一个复杂的脚本来旋转,直到你找到一个工作时间标记服务器..但是,真的吗?
我们应该要求更好.我们为这些证书支付了很多钱.
请注意,我后来发现很少有人听说过的备用时间戳服务器可以在Verisign和Comodo停机期间使用(通常在工作日的工作时间内发生).
| 归档时间: |
|
| 查看次数: |
62294 次 |
| 最近记录: |