签名工具和 300 MB 的大小限制(代码签名和验证)

Sign Tool and the size limit of 300 MB (Code Signing and Validation)

在 2018 年签名工具的文档中,它在页面底部指出,如果文件大小超过 300 MB 且 PC 为 [=25,则由签名工具签名的文件可能无法可靠地验证=] Windows XP Service Pack 2 或更高版本。

我的第一个问题是这里是否有人知道这是否意味着 Windows 7 和 Windows 10 将被包括在内,我的另一个问题是这个失败到底是什么样的?他们在 blurb 下页面上的文章不再起作用,所以我被迫从其他可能亲身经历过这个问题的人那里寻找答案。这些注释似乎表明当验证签名的资源紧张或有限时会出现问题。

我指的是这个页面https://docs.microsoft.com/en-us/windows/win32/seccrypto/signtool

具体摘录是这样的...

When signing an executable file that is larger than approximately 300 megabytes for use on a computer running Windows XP with Service Pack 2 (SP2) and later, you should use catalog signing with the MakeCat tool rather than use the SignTool tool. Depending on the available system resources of the computer on which the file is verified, some applications may not be able to verify the binary signature of a large file. For more information, see KB article 922225.

知识库文章 922225 似乎不再存在。

这是我从未听说过的问题,我经常使用 signtool 对超过 1gb 的文件进行签名并且从未遇到过任何问题。

四处寻找,我唯一能找到的参考资料是这个,它似乎来自 Microsoft 员工:https://groups.google.com/forum/#!msg/microsoft.public.security.crypto/Vyqbg8m9_vg/yexXlOkT2JgJ

Yes this is a known limitation of the windows infrastructure. It is a problem with the OS, not signtool itself. It was fixed on Vista but has not been backported to XP or Windows 2003.

...you cannot verify or sign files larger than about 300MB on XP or Windows 2003. The guidance is to break up large files into multiple smaller files.

看起来在 Vista 或更高版本上,您可以对大于 300mb 的文件使用 signtool,它们工作正常(在 Vista 和更高版本上),但它们无法在旧操作系统上验证。这解释了为什么我在实践中从未见过这种情况,因为我只使用 Windows 7+ 签名,而不是 运行 在早于 Vista 的操作系统上。

我碰巧有一个以这种方式签名的 964MB 签名文件,还有一台 Windows XP 机器,所以我复制了它,这是我发现的:查看文件属性 'Digital Signatures' 选项卡没有显示,就好像文件没有签名一样(显示在一个小的签名文件旁边以供比较)。该文件否则按预期工作。