Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to include entire certification path when signing code with signtool?

Tags:

code-signing

How can i include the entire certification path when signing code using signtool?

Older versions of signtool would include the entire certification path in a digital signature. As it is now if i sign an executable with signtool:

signtool.exe" sign /v /f avatar.pfx -t "http://timestamp.verisign.com/scripts/timstamp.dll" app.exe

the signature is not valid:

enter image description here

This is because there is no certification path:

enter image description here

Binaries signed with the older version of signtool worked fine:

enter image description here

How do i tell signcode to include the entire certification path when signing?

What is the proper way to sign a binary?


Update: SignTool version 6.1.7600.16385:

enter image description here

See also

  • How can I sign an ActiveX control with a code signing certificate and be a verified publisher?
  • Signing WinForms ClickOnce app with Certificate Chain
  • ClickOnce: Certificate cannot be validated
like image 611
Ian Boyd Avatar asked Jul 04 '11 19:07

Ian Boyd


2 Answers

Use /ac and pass the filename of the .cer in which your certificate is rooted (for Verisign it was called MSCV-VSClass3.cer last time I checked when signing kernel code or other special code).

signtool.exe sign /v /f "Avatar.pfx" 
      /ac "Thawte Code Signing CA - G2.cer" 
      -t "http://timestamp.verisign.com/scripts/timstamp.dll" app.exe

This should be given by your CA. Usually MS offers bundles for the various CAs it accepts within Windows.

See:

  • Windows root certificate program members 🕗
  • Cross-Certificates for Kernel Mode Code Signing 🕗

Either way, to my knowledge this is only required for kernel code and very specific other things (e.g. Windows Security Center).

like image 166
0xC0000022L Avatar answered Oct 19 '22 19:10

0xC0000022L


If you use Thawte then download their primaryca.cer.

Download to file primaryca.cer and sign your file with:

signtool sign /f certificate.pfx /p PASSWORD /ac primaryca.cer APP.exe.

Should work.

like image 38
eleldidi Avatar answered Oct 19 '22 19:10

eleldidi