| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The Go crypto library used to be simple and nice and an example of how
to do things well. Unfortunately, the addition of FIPS140 to it has
brought disgusting enterprise patterns and gummed up the code. One place
this really comes out is in the insane infrastructure behind the RNG. It
really only should be calling the system random functions and nothing
more. But in contemporary Go, simply calling into the RNG brings along
with it in the binary:
- A bizarre voodoo magic userspace entropy collector
- A specialized SHA384 implementation for said entropy collector
- An AES implementation
- An AES-NI accelerated AES implementation
- A CTR implementation for AES
- A GCM implementation for AES
- Some CPU detection code
- An implementation of some FIPS-specified DRBG algorithm
- An HMAC implementation
- A SHA256 implementation
- An AVX2-accelerated SHA256 implementation
- A SHA3 implementation (including cSHAKE)
- An AVX2-accelerated SHA3 implementation
- A SHA512 implementation
- Some generic XOR-bytes routines
- The actual syscall wrappers for getting random numbers
Obviously this is completely insane. There's a tangled mess of
components including eachother, a disorganized patchwork of FIPS code
and BoringCrypto code and enterprisey API hooks and self checks and
auto-included initializers. It seems like a mess of a library these
days.
So, here we beat down this madness by using a Go build overlay to
replace various parts of the crypto library with stub functions. This is
pretty nasty. But at least it compiles out some of this junk.
I'm trying to fix this upstream in the meanwhile [1], and so we'll see
what comes of that.
Link: https://github.com/golang/go/issues/81639
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
| |
Keep the Go toolchain under .deps\go to match the Linux build layout.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
| |
Use crypto/ecdh directly, because the old x/crypto 25519 library was
wrapping it.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
| |
Part of the API contract, apparently.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
| |
The CIDR byte follows the 16-byte address and two-byte address family,
placing it at offset 18. Add the missing flags field at offset 20 and
its Remove flag to match the native structure.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Since we're also bumping the PE subsystem header to 10.0, this means we
need a _load_config with the proper flags. So there's some work to be
done here.
This also means bumping LLVM and Go builds. In the case of Go, the patch
is still pending: https://go-review.googlesource.com/c/go/+/756680 , so
it's a custom build.
Remove lots of compatibility code and hacks. Also update the installer
to display a useful message.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
|
|
| |
Existing code signing was hard-coded to use a locally installed
certificate (hardware security dongles included). However, signtool.exe
is extensible to allow any kind of digest signing plugin with /dlib and
/dmdf switches. This is used for cloud-based code signing (e.g.
Microsoft Trusted Signing).
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
| |
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
| |
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
| |
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
| |
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
| |
Also remove Wintun driver on startup.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
|
|
| |
ADDRESS_FAMILY is a u16, not a u32.
C# promotes a ushort to an int, not to a short, so ntohl was being
called instead of ntohs. Fix this with explicit casts.
Reported-by: Neutron <dotneutron@protonmail.ch>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
| |
wireguard.h uses the WINAPI macro, which is __stdcall, so mark these as
such.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
| |
Requested-by: Dmitry Smirnov <dmitry.smirnov@netprotect.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
| |
Reported-by: Dmitry Smirnov <dmitry.smirnov@netprotect.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Simon Rozman <simon@rozman.si>
|
| |
|
|
|
|
|
| |
Also, enable arm64 embeddable tunnel service building.
Requested-by: Dmitry Smirnov <dmitry.smirnov@netprotect.com>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
| |
We now pass a LPWSTR instead of a Go string.
Reported-by: Fabrizio Carimati <wireguard@clodo.it>
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
| |
It's probably best to encourage people start out in the right direction.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
|
|
| |
We build Go from modified-source with a bootstrap version, rather than
shipping so many patches in this repo.
This commit also removes the previous WOW hacks, and goes back to
strictly forbidding WOW.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
| |
This avoids the somewhat expensive pipe setup.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
|
|
| |
Avoids "converted pointer straddles allocation" failures at runtime
when building binaries in race mode with Go 1.15, which enables
checkptr: https://golang.org/doc/go1.15#windows
Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
[Jason: Note Go 1.16/1.17 todo item.]
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
| |
This prevents this from coming back after boot, since we probably want
it tied to the parent process.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
|
|
|
|
| |
BCrypt is Win10+ and kind of clunky to use. The tunnel.dll binary has
this code in it anyway, so doing it there doesn't actually increase
the size of the binary.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
| |
|
|
| |
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|
|
|
This allows people to embed WireGuard inside other apps as a service.
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
|