Closed scott-xu closed 1 year ago
The error is "ASN1 bad tag value met."
How's the progress on this task? I'm also experiencing a similar error when signing a vsix.
This is a bug in VsixSignTool. The signature part XML for the timestamp looks like this (without formatting, and with UTF-8 BOM):
Signed with VsixSignTool:
<Object xmlns="http://www.w3.org/2000/09/xmldsig#">
<TimeStamp Id="idSignatureTimestamp" xmlns="http://schemas.openxmlformats.org/package/2006/digital-signature">
<Comment>Timestamp got from the time stamp server</Comment>
<EncodedTime>...
Signed with OpenVsixSignTool:
<Object xmlns="http://www.w3.org/2000/09/xmldsig#">
<TimeStamp Id="idSignatureTimestamp" xmlns="http://schemas.openxmlformats.org/package/2006/digital-signature">
<Comment></Comment>
<EncodedTime>...
Note that VsixSignTool adds a comment.
When extracting the <EncodedTime>
value, VsixSignTool does not parse the XML, but reads the string starting at the fixed offset 236. Without the comment, this offset is in the middle of the value, and subsequently CryptVerifyTimeStampSignature
complains about bad input.
OpenVsixSignTool could add the (useless) comment for compat. But really Microsoft should fix their tool. VSIXInstaller works fine anyway.
Steps to reproduce: