diff options
author | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-09 02:20:40 +0200 |
---|---|---|
committer | Jason A. Donenfeld <Jason@zx2c4.com> | 2019-04-09 02:20:40 +0200 |
commit | 5004a12c6b30d72c7f53b8cf35c44717d739d32e (patch) | |
tree | 366b52f94be86b86282c43bdd195a892b1581fb7 | |
parent | service: use WireGuardTunnel$ prefix (diff) | |
download | wireguard-windows-5004a12c6b30d72c7f53b8cf35c44717d739d32e.tar.xz wireguard-windows-5004a12c6b30d72c7f53b8cf35c44717d739d32e.zip |
build: go 1.12.2 contains my fix for CVE-2019-9634
Diffstat (limited to '')
-rw-r--r-- | Makefile | 13 | ||||
-rw-r--r-- | README.md | 2 | ||||
-rw-r--r-- | build.bat | 13 |
3 files changed, 5 insertions, 23 deletions
@@ -4,26 +4,17 @@ WINDRES := x86_64-w64-mingw32-windres export CGO_ENABLED := 1 export GOOS := windows export GOARCH := amd64 -REAL_GOROOT := $(shell go env GOROOT) -export GOROOT := $(PWD)/.deps/go -export PATH := $(GOROOT)/bin:$(PATH) DEPLOYMENT_HOST ?= winvm DEPLOYMENT_PATH ?= Desktop all: wireguard.exe -.deps/prepared: - mkdir -p .deps - rsync -a --delete --exclude=pkg/obj/go-build "$(REAL_GOROOT)/" "$(GOROOT)/" - patch -f -N -r- -d .deps/go -p1 < golang-runtime-dll-injection.patch - touch "$@" - resources.syso: resources.rc manifest.xml ui/icon/icon.ico $(WINDRES) -i $< -o $@ -O coff rwildcard=$(foreach d,$(wildcard $1*),$(call rwildcard,$d/,$2) $(filter $(subst *,%,$2),$d)) -wireguard.exe: resources.syso $(call rwildcard,,*.go *.c *.h) .deps/prepared +wireguard.exe: resources.syso $(call rwildcard,,*.go *.c *.h) go build -ldflags="-H windowsgui -s -w" -v -o $@ deploy: wireguard.exe @@ -31,6 +22,6 @@ deploy: wireguard.exe scp wireguard.exe $(DEPLOYMENT_HOST):$(DEPLOYMENT_PATH) clean: - rm -rf resources.syso wireguard.exe .deps + rm -rf resources.syso wireguard.exe .PHONY: deploy clean all @@ -5,7 +5,7 @@ Nothing to see here yet. Come back later. ### Requirements - [Wintun](https://git.zx2c4.com/wintun) (at runtime) - - [Go 1.12](https://golang.org/) (for compilation) + - [Go ≥1.12.2](https://golang.org/) (for compilation) - [Mingw](http://www.mingw.org/) (for compilation) ### Building on Windows @@ -8,7 +8,7 @@ if exist .deps\prepared goto :build mkdir .deps || goto :error cd .deps || goto :error echo [+] Downloading golang - curl -#fo go.zip https://dl.google.com/go/go1.12.windows-amd64.zip || goto :error + curl -#fo go.zip https://dl.google.com/go/go1.12.3.windows-amd64.zip || goto :error echo [+] Verifying golang for /f %%a in ('CertUtil -hashfile go.zip SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="880ced1aecef08b3471a84381b6c7e2c0e846b81dd97ecb629b534d941f282bd" goto :error echo [+] Downloading mingw @@ -16,21 +16,12 @@ if exist .deps\prepared goto :build curl -#fo mingw.zip https://download.wireguard.com/windows-toolchain/distfiles/x86_64-w64-mingw32-native-20190307.zip || goto :error echo [+] Verifying mingw for /f %%a in ('CertUtil -hashfile mingw.zip SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="5390762183e181804b28eb13815b6210f85a1280057b815f749b06768215f817" goto :error - echo [+] Downloading patch - rem Mirror of https://sourceforge.net/projects/gnuwin32/files/patch/2.5.9-7/patch-2.5.9-7-bin.zip with fixed manifest - curl -#fo patch.zip https://download.wireguard.com/windows-toolchain/distfiles/patch-2.5.9-7-bin-fixed-manifest.zip || goto :error - echo [+] Verifying patch - for /f %%a in ('CertUtil -hashfile patch.zip SHA256 ^| findstr /r "^[0-9a-f]*$"') do if not "%%a"=="25977006ca9713f2662a5d0a2ed3a5a138225b8be3757035bd7da9dcf985d0a1" goto :error echo [+] Extracting golang tar -xf go.zip || goto :error echo [+] Extracting mingw tar -xf mingw.zip || goto :error - echo [+] Extracting patch - tar -xf patch.zip --strip-components 1 bin || goto :error - echo [+] Patching golang - .\patch.exe -f -N -r- -d go -p1 --binary < ..\golang-runtime-dll-injection.patch || goto :error echo [+] Cleaning up - del patch.exe patch.zip go.zip mingw.zip || goto :error + del go.zip mingw.zip || goto :error copy /y NUL prepared > NUL || goto :error cd .. || goto :error |