Skip to content

Commit

Permalink
sign drivers and apps. win 64bit requires a signed driver (because it…
Browse files Browse the repository at this point in the history
… sucks)
  • Loading branch information
Andrea Bittau committed Oct 14, 2010
1 parent b0fd460 commit 128e63a
Show file tree
Hide file tree
Showing 10 changed files with 81 additions and 21 deletions.
3 changes: 2 additions & 1 deletion contrib/winlauncher/Makefile
Original file line number Original file line Diff line number Diff line change
@@ -1,5 +1,6 @@
CC = $(PREFIX)gcc CC = $(PREFIX)gcc
CXX = $(PREFIX)g++ CXX = $(PREFIX)g++
CC = $(CXX)


WIX = wine /root/.wine/drive_c/Program\ Files/Windows\ Installer\ XML\ v3/bin/ WIX = wine /root/.wine/drive_c/Program\ Files/Windows\ Installer\ XML\ v3/bin/
CANDLE = $(WIX)candle CANDLE = $(WIX)candle
Expand All @@ -13,7 +14,7 @@ LDFLAGS = -lgdi32 -lsetupapi -lws2_32 -lole32 -luuid \


OBJS = tcpcrypt.o res.o netcfgapi.o OBJS = tcpcrypt.o res.o netcfgapi.o


all: $(NAME) tcpcrypt.msi all: $(NAME)


res.o: res.rc resource.h tcpcrypt.exe.manifest res.o: res.rc resource.h tcpcrypt.exe.manifest
$(PREFIX)windres $(<) $(@) $(PREFIX)windres $(<) $(@)
Expand Down
1 change: 1 addition & 0 deletions contrib/winlauncher/signexe.bat
Original file line number Original file line Diff line number Diff line change
@@ -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
1 change: 1 addition & 0 deletions contrib/winlauncher/signmsi.bat
Original file line number Original file line Diff line number Diff line change
@@ -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
3 changes: 1 addition & 2 deletions contrib/winlauncher/tcpcrypt.c
Original file line number Original file line Diff line number Diff line change
@@ -1,7 +1,6 @@
#include <windows.h> #include <windows.h>
#include <stdio.h> #include <stdio.h>
#include <devguid.h> #include <devguid.h>
#include <winsock2.h>
#include <unistd.h> #include <unistd.h>


#define COBJMACROS #define COBJMACROS
Expand Down Expand Up @@ -424,7 +423,7 @@ static void do_init(void)


static void hof(void) static void hof(void)
{ {
if (((int) ShellExecute(NULL, (LPCTSTR) "open", if (((long long) ShellExecute(NULL, (LPCTSTR) "open",
"http://tcpcrypt.org/fame.php", "http://tcpcrypt.org/fame.php",
NULL, ".\\", SW_SHOWNORMAL)) < 33) NULL, ".\\", SW_SHOWNORMAL)) < 33)
err(1, "ShellExecute()"); err(1, "ShellExecute()");
Expand Down
76 changes: 60 additions & 16 deletions contrib/winlauncher/tcpcrypt.wxs
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -19,26 +19,64 @@
<Directory Id='tcpcrypt' Name="tcpcrypt"> <Directory Id='tcpcrypt' Name="tcpcrypt">
<Component Id='tcpcrypt' Guid='6660071f-d011-4d68-b2ed-1e6c19b1ccdd'> <Component Id='tcpcrypt' Guid='6660071f-d011-4d68-b2ed-1e6c19b1ccdd'>
<RemoveFolder Id='tcpcrypt' On='uninstall' /> <RemoveFolder Id='tcpcrypt' On='uninstall' />
<File Id='tcpcrypt' Name='tcpcrypt.exe' DiskId='1' <File Id='tcpcryptd' Name='tcpcryptd.exe' DiskId='1'
Source='tcpcrypt.exe' KeyPath='yes'> Source='../../user/tcpcrypt/tcpcryptd.exe' />
<Shortcut Id="start" Directory="ProgramMenuDir"
<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" Name="tcpcrypt"
WorkingDirectory='INSTALLDIR' WorkingDirectory='INSTALLDIR'
Icon="tcpcrypt.exe" IconIndex="0" Icon="tcpcrypt.exe" IconIndex="0"
Advertise="yes" /> Advertise="yes" />
</File> </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' <File Id='passthru' Name='passthru.sys' DiskId='1'
Source='../../kernel/win/objchk_wxp_x86/i386/passthru.sys' /> Source='../../kernel/win/stage64/passthru.sys' />
<File Id='netsf_m' Name='netsf_m.inf' DiskId='1'
Source='../../kernel/win/netsf_m.inf' /> <File Id='netsf_m_cat' Name='netsf_m.cat' DiskId='1'
<File Id='netsf' Name='netsf.inf' DiskId='1' Source='../../kernel/win/stage64/netsf_m.cat' />
Source='../../kernel/win/netsf.inf' />
<File Id='libcrypto_8' Name='libcrypto-8.dll' DiskId='1' Source='libcrypto-8.dll' /> <File Id='netsf_cat' Name='netsf.cat' DiskId='1'
<File Id='zlib1' Name='zlib1.dll' DiskId='1' Source='zlib1.dll' /> 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> </Component>
</Directory> </Directory>
</Directory> </Directory>
Expand All @@ -53,10 +91,15 @@


<Feature Id='Complete' Level='1'> <Feature Id='Complete' Level='1'>
<ComponentRef Id='tcpcrypt' /> <ComponentRef Id='tcpcrypt' />
<ComponentRef Id='tcpcrypt_driver64' />
<ComponentRef Id='tcpcrypt_driver32' />
</Feature> </Feature>


<CustomAction Id='LaunchFile' FileKey='tcpcrypt' Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /i' Return='check' /> <Property Id='TCPCRYPT'>666</Property>
<CustomAction Id='uninst' FileKey='tcpcrypt' Execute="deferred" Impersonate="no" ExeCommand='tcpcrypt /u' Return='check' /> <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' <!--CustomAction Id='LaunchTcpcrypt' FileKey='tcpcrypt'
ExeCommand='tcpcrypt' Return='asyncNoWait' /--> ExeCommand='tcpcrypt' Return='asyncNoWait' /-->


Expand Down Expand Up @@ -141,6 +184,7 @@
</UI> </UI>


<InstallExecuteSequence> <InstallExecuteSequence>
<Custom Action="PropertyAssign" After="CostFinalize" />
<Custom Action='LaunchFile' After="InstallFiles">NOT Installed</Custom> <Custom Action='LaunchFile' After="InstallFiles">NOT Installed</Custom>
<Custom Action="uninst" Before="RemoveFiles">Installed AND NOT UPGRADINGPRODUCTCODE</Custom> <Custom Action="uninst" Before="RemoveFiles">Installed AND NOT UPGRADINGPRODUCTCODE</Custom>
</InstallExecuteSequence> </InstallExecuteSequence>
Expand Down
10 changes: 10 additions & 0 deletions kernel/win/dosign.bat
Original file line number Original file line Diff line number Diff line change
@@ -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
3 changes: 2 additions & 1 deletion kernel/win/netsf.inf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -49,7 +49,8 @@ Signature = "$Windows NT$"
Class = NetService Class = NetService
ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318} ClassGUID = {4D36E974-E325-11CE-BFC1-08002BE10318}
Provider = %Msft% Provider = %Msft%
DriverVer =10/01/2002,6.0.5019.0 DriverVer =10/01/2010,6.0.5019.0
CatalogFile = netsf.cat


[Manufacturer] [Manufacturer]
%Msft% = MSFT,NTx86,NTia64,NTamd64 %Msft% = MSFT,NTx86,NTia64,NTamd64
Expand Down
3 changes: 2 additions & 1 deletion kernel/win/netsf_m.inf
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ signature = "$Windows NT$"
Class = Net Class = Net
ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318} ClassGUID = {4d36e972-e325-11ce-bfc1-08002be10318}
Provider = %Msft% Provider = %Msft%
DriverVer =10/01/2002,6.0.5019.0 DriverVer =10/01/2010,6.0.5019.0
CatalogFile = netsf_m.cat


[ControlFlags] [ControlFlags]
ExcludeFromSelect = ms_passthrump ExcludeFromSelect = ms_passthrump
Expand Down
Binary file removed kernel/win/passthru.sys
Binary file not shown.
2 changes: 2 additions & 0 deletions kernel/win/sign.bat
Original file line number Original file line Diff line number Diff line change
@@ -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.