certificatesspi

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


In the documentation from 2018 for the Sign Tool, it states at the bottom of the page that files signed by sign tool may not be reliably verified if the size of the file exceeds 300 MB and the PC is running Windows XP Service Pack 2 or later.

My first question is if anyone here knows if this means that Windows 7 and Windows 10 would be included, and the other question I have is what exactly does this failure look like? The article they had on the page under the blurb no longer functions so I'm being forced to search for answers from others who might have experienced this issue first hand. The notes appear to indicate issues occur when resources on the side verifying the signature are stressed or limited.

The page I'm referring to is this one https://learn.microsoft.com/en-us/windows/win32/seccrypto/signtool

The excerpt in specific is this...

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.

KB article 922225 doesn't appear to exist anymore.


Solution

  • This is a problem I've never heard of, and I frequently sign files using signtool that are over 1gb and have never had any problems.

    Digging around, the only reference I could find was this, which appears to be from a Microsoft employee: 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.

    It looks like on Vista or higher you can use signtool on files >300mb and they work fine (On Vista and higher), but they won't verify on older OSs. This explains why I've never seen this in practice, since I only sign using Windows 7+ and don't run on OSs older than Vista.

    I happen to have a signed 964MB file sitting around that was signed this way and also a Windows XP machine, so I copied it over and here's what I found: looking at the file properties the the 'Digital Signatures' tab doesn't show up, as if the file wasn't signed (shown beside a small, signed file for comparison). The file otherwise works as expected.

    file appears unsigned