Permalink
Browse files

sign drivers and apps. win 64bit requires a signed driver (because it…

… sucks)
  • Loading branch information...
Andrea Bittau
Andrea Bittau committed Oct 14, 2010
1 parent b0fd460 commit 128e63a3fd5cc4e82b1c286a42a94e2c87272572
@@ -1,5 +1,6 @@
CC = $(PREFIX)gcc
CXX = $(PREFIX)g++
+CC = $(CXX)
WIX = wine /root/.wine/drive_c/Program\ Files/Windows\ Installer\ XML\ v3/bin/
CANDLE = $(WIX)candle
@@ -13,7 +14,7 @@ LDFLAGS = -lgdi32 -lsetupapi -lws2_32 -lole32 -luuid \
OBJS = tcpcrypt.o res.o netcfgapi.o
-all: $(NAME) tcpcrypt.msi
+all: $(NAME)
res.o: res.rc resource.h tcpcrypt.exe.manifest
$(PREFIX)windres $(<) $(@)
@@ -0,0 +1 @@
+signtool sign /v /ac c:\certs\MSCV-VSClass3.cer /s my /n "Stanford University" /t http://timestamp.verisign.com/scripts/timestamp.dll tcpcrypt32.exe tcpcrypt64.exe ..\..\user\tcpcrypt\tcpcryptd.exe ..\..\user\util\tcnetstat.exe
@@ -0,0 +1 @@
+signtool sign /v /ac c:\certs\MSCV-VSClass3.cer /s my /n "Stanford University" /t http://timestamp.verisign.com/scripts/timestamp.dll tcpcrypt.msi
@@ -1,7 +1,6 @@
#include <windows.h>
#include <stdio.h>
#include <devguid.h>
-#include <winsock2.h>
#include <unistd.h>
#define COBJMACROS
@@ -424,7 +423,7 @@ static void do_init(void)
static void hof(void)
{
- if (((int) ShellExecute(NULL, (LPCTSTR) "open",
+ if (((long long) ShellExecute(NULL, (LPCTSTR) "open",
"http://tcpcrypt.org/fame.php",
NULL, ".\\", SW_SHOWNORMAL)) < 33)
err(1, "ShellExecute()");
@@ -19,26 +19,64 @@
<Directory Id='tcpcrypt' Name="tcpcrypt">
<Component Id='tcpcrypt' Guid='6660071f-d011-4d68-b2ed-1e6c19b1ccdd'>
<RemoveFolder Id='tcpcrypt' On='uninstall' />
- <File Id='tcpcrypt' Name='tcpcrypt.exe' DiskId='1'
- Source='tcpcrypt.exe' KeyPath='yes'>
- <Shortcut Id="start" Directory="ProgramMenuDir"
+ <File Id='tcpcryptd' Name='tcpcryptd.exe' DiskId='1'
+ Source='../../user/tcpcrypt/tcpcryptd.exe' />
+
+ <File Id='tcnetstat' Name='tcnetstat.exe' DiskId='1'
+ Source='../../user/util/tcnetstat.exe' />
+
+ <File Id='libcrypto_8' Name='libcrypto-8.dll' DiskId='1' Source='libcrypto-8.dll' />
+
+ <File Id='zlib1' Name='zlib1.dll' DiskId='1' Source='zlib1.dll' />
+
+ <File Id='netsf_m' Name='netsf_m.inf' DiskId='1'
+ Source='../../kernel/win/netsf_m.inf' />
+
+ <File Id='netsf' Name='netsf.inf' DiskId='1'
+ Source='../../kernel/win/netsf.inf' />
+ </Component>
+
+ <Component Id='tcpcrypt_driver64' Guid='6660071f-d011-4d68-b2ed-1e6c19b1cc64'>
+ <Condition>VersionNT64</Condition>
+ <File Id='tcpcrypt64' Name='tcpcrypt.exe' DiskId='1'
+ Source='tcpcrypt64.exe' KeyPath='yes'>
+ <Shortcut Id="start64" Directory="ProgramMenuDir"
Name="tcpcrypt"
WorkingDirectory='INSTALLDIR'
Icon="tcpcrypt.exe" IconIndex="0"
Advertise="yes" />
</File>
- <File Id='tcpcryptd' Name='tcpcryptd.exe' DiskId='1'
- Source='../../user/tcpcrypt/tcpcryptd.exe' />
- <File Id='tcnetstat' Name='tcnetstat.exe' DiskId='1'
- Source='../../user/util/tcnetstat.exe' />
+
<File Id='passthru' Name='passthru.sys' DiskId='1'
- Source='../../kernel/win/objchk_wxp_x86/i386/passthru.sys' />
- <File Id='netsf_m' Name='netsf_m.inf' DiskId='1'
- Source='../../kernel/win/netsf_m.inf' />
- <File Id='netsf' Name='netsf.inf' DiskId='1'
- Source='../../kernel/win/netsf.inf' />
- <File Id='libcrypto_8' Name='libcrypto-8.dll' DiskId='1' Source='libcrypto-8.dll' />
- <File Id='zlib1' Name='zlib1.dll' DiskId='1' Source='zlib1.dll' />
+ Source='../../kernel/win/stage64/passthru.sys' />
+
+ <File Id='netsf_m_cat' Name='netsf_m.cat' DiskId='1'
+ Source='../../kernel/win/stage64/netsf_m.cat' />
+
+ <File Id='netsf_cat' Name='netsf.cat' DiskId='1'
+ Source='../../kernel/win/stage64/netsf.cat' />
+ </Component>
+
+ <Component Id='tcpcrypt_driver32' Guid='6660071f-d011-4d68-b2ed-1e6c19b1cc32'>
+ <Condition>NOT VersionNT64</Condition>
+
+ <File Id='tcpcrypt32' Name='tcpcrypt.exe' DiskId='1'
+ Source='tcpcrypt32.exe' KeyPath='yes'>
+ <Shortcut Id="start32" Directory="ProgramMenuDir"
+ Name="tcpcrypt"
+ WorkingDirectory='INSTALLDIR'
+ Icon="tcpcrypt.exe" IconIndex="0"
+ Advertise="yes" />
+ </File>
+
+ <File Id='passthru32' Name='passthru.sys' DiskId='1'
+ Source='../../kernel/win/stage32/passthru.sys' />
+
+ <File Id='netsf_m_cat32' Name='netsf_m.cat' DiskId='1'
+ Source='../../kernel/win/stage32/netsf_m.cat' />
+
+ <File Id='netsf_cat32' Name='netsf.cat' DiskId='1'
+ Source='../../kernel/win/stage32/netsf.cat' />
</Component>
</Directory>
</Directory>
@@ -53,10 +91,15 @@
<Feature Id='Complete' Level='1'>
<ComponentRef Id='tcpcrypt' />
+ <ComponentRef Id='tcpcrypt_driver64' />
+ <ComponentRef Id='tcpcrypt_driver32' />
</Feature>
- <CustomAction Id='LaunchFile' FileKey='tcpcrypt' Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /i' Return='check' />
- <CustomAction Id='uninst' FileKey='tcpcrypt' Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /u' Return='check' />
+ <Property Id='TCPCRYPT'>666</Property>
+ <CustomAction Id='PropertyAssign' Property='TCPCRYPT' Value='[ProgramFilesFolder]tcpcrypt/tcpcrypt.exe' />
+
+ <CustomAction Id='LaunchFile' Property="TCPCRYPT" Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /i' Return='check' />
+ <CustomAction Id='uninst' Property="TCPCRYPT" Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /u' Return='check' />
<!--CustomAction Id='LaunchTcpcrypt' FileKey='tcpcrypt'
ExeCommand='tcpcrypt' Return='asyncNoWait' /-->
@@ -141,6 +184,7 @@
</UI>
<InstallExecuteSequence>
+ <Custom Action="PropertyAssign" After="CostFinalize" />
<Custom Action='LaunchFile' After="InstallFiles">NOT Installed</Custom>
<Custom Action="uninst" Before="RemoveFiles">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence>
View
@@ -0,0 +1,10 @@
+md %2
+
+copy /y %1\passthru.sys %2\
+copy *.inf %2\
+
+signtool sign /v /ac c:\certs\MSCV-VSClass3.cer /s my /n "Stanford University" /t http://timestamp.verisign.com/scripts/timestamp.dll %2\passthru.sys
+
+inf2cat /driver:%2 /os:XP_X64,Vista_X64,7_X64,Server2003_X64,Server2003_IA64,Server2008_X64,Server2008_IA64,Server2008R2_X64,Server2008R2_IA64,XP_X86,Vista_X86,7_X86,Server2003_X86,Server2008_X86
+
+signtool sign /v /ac c:\certs\MSCV-VSClass3.cer /s my /n "Stanford University" /t http://timestamp.verisign.com/scripts/timestamp.dll %2/netsf.cat %2/netsf_m.cat
View
@@ -49,7 +49,8 @@ Signature = "$Windows NT$"
Class = NetService
ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318}
Provider = %Msft%
-DriverVer =10/01/2002,6.0.5019.0
+DriverVer =10/01/2010,6.0.5019.0
+CatalogFile = netsf.cat
[Manufacturer]
%Msft% = MSFT,NTx86,NTia64,NTamd64
View
@@ -24,7 +24,8 @@ signature = "$Windows NT$"
Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Msft%
-DriverVer =10/01/2002,6.0.5019.0
+DriverVer =10/01/2010,6.0.5019.0
+CatalogFile = netsf_m.cat
[ControlFlags]
ExcludeFromSelect = ms_passthrump
View
Binary file not shown.
View
@@ -0,0 +1,2 @@
+call dosign objchk_wlh_amd64\amd64 stage64
+call dosign objchk_wxp_x86\i386 stage32

0 comments on commit 128e63a

Please sign in to comment.