Table des matières
Signer pour Vista
clef prive
Acquerir un certificat et une clef pour signer.
Par exemple, ici:
http://www.globalsign.com/digital_certificate/objectsign/index.cfm
Recuperer aussi le certificat GlobalSign
par là:
http://www.microsoft.com/whdc/winlogo/drvsign/crosscert.mspx#ENG
Il y a aussi des Root trucs a installer a partir d'ici:
http://www.globalsign.com/support/root-certificate/osroot.htm
(sinon, la signature se fera mais Windows dira toujours qu'il est incapable de valider la signature)
A la fin, sur la machine avec laquelle on s'est inscrit, on récupère par mail un lien. En suivant le lien, on installe les clefs dans son trousseau.
Ca fonctionne bien sous Debian avec Firefox/Iceweasel.
On peut alors extraire les clefs pour obtenir un fichier .PFX
.
Ce fichier pourra ensuite être ingéré par Windows qui le mettra dans son trousseau.
Pour les exemples qui vont suivre, mon CN
est TJ-industrie
.
signtool
Trouver une version récente de signtool
, la seule capable de signe pour Authenticode
.
Pour cela, j'ai télécharger chez Micro$oft, le SDK suivant:
6.0.6000.0.0.WindowsSDK_Vista_rtm.DVD.Rel.img
(Avec wget
sous Debian, ca marche aussi)
Lien: http://www.microsoft.com/downloads
Si on a pas les moyens d'installer ce SDK (car il faut XP et peut etre Vista à l'instant où vous me lisez), alors il faut mounter l'image .IMG
.
Sous Windows
Installer et utiliser DAEMON Tools
( http://www.telecharger.com ) et mounter l'image CD.
Extraire WinSDKTools-WinDSKTools-common.0.cab
et renommer le fichier signtool_exe_…
en signtool.exe
. Et voilà, on est prêt a signer.
Sous Linux
# mount -r -t udf 6.0.6000.0.0.WindowsSDK_Vista_rtm.DVD.Rel.img /mnt/iso -o loop
Et faire un truc similaire à ci-dessus.
Inf2Cat
Telecharger là: https://winqual.microsoft.com/Help/Inf2cat_FAQ.htm
Il faut installer winqual
sous XP ou plus… Je l'ai fait sous Vista 64x… ca marche.
Signer les pilotes
J'ai creer un .bat
contenant ça:
@echo off set TimeURL=http://timestamp.globalsign.com set CER=..\..\MSCV\MSCV-GlobalSign.cer SignTool sign /v /ac "%CER%" /s my /n "TJ-Industrie" /i GlobalSign /t "%TimeURL%" "pilote.sys" SignTool sign /v /ac "%CER%" /s my /n "TJ-Industrie" /i GlobalSign /t "%TimeURL%" "pilote32.sys" SignTool sign /v /ac "%CER%" /s my /n "TJ-Industrie" /i GlobalSign /t "%TimeURL%" "pilote64.sys" SignTool sign /v /ac "%CER%" /s my /n "TJ-Industrie" /i GlobalSign /t "%TimeURL%" "piloteia64.sys"
Donc je fais:
> signnow.bat
Creer catalog
Mettre les pilotes signer dans un répertoire, avec le .inf
.
S'assurer que le .inf
contient des lignes comme cela:
CatalogFile=mon_pilote.cat CatalogFile.ntx86=mon_pilote.cat CatalogFile.ntamd64=mon_pilote.cat CatalogFile.ntia64=mon_pilote.cat
Et enfin lancer la commande suivante:
> inf2cat /drv:repertoire_des_pilotes /os:XP_X86,2000,Server2003_X86,Vista_X86,XP_X64,Server2003_X64,Vista_X64,Server2003_IA64 /v
Ce que ca fait:
- recherche un
.inf
- creer le catalog en fonction du
.inf
- le catalog porte le nom donné dans le
.inf
Signer le catalog
J'ai un simple .bat
comme cela:
@echo off set TimeURL=http://timestamp.globalsign.com set CER=..\..\MSCV\MSCV-GlobalSign.cer SignTool sign /v /ac "%CER%" /s my /n "TJ-industrie" /i GlobalSign /t "%TimeURL%" "mon_pilote.cat"
Et voila.
Signer a partir de Visual Studio
Dans le “Build Event > Post Build Event” , ajouter quelques choses comme ça:
<PATH>\SignTool.exe sign /v /ac "<PATH>\MSCV-GlobalSign.cer" /s my /n "TJ-industrie" \ /i GlobalSign /t http://timestamp.globalsign.com $(OutDir)\$(ProjectName).exe