summaryrefslogtreecommitdiffhomepage
AgeCommit message (Collapse)Author
2017-11-29device: clear last handshake timer on ifdownJason A. Donenfeld
Otherwise new handshakes might not occur immediately when the interface goes up and down. Also initialize peers to having a proper zeroed handshake jiffies. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-29compat: fix 3.10 backportJason A. Donenfeld
For archs that do not provide the magic csum function, we need to provide the generic function. Also, some obscure 3.10s have backported the int size macros, so we ifndef around that to avoid potentially fatal warnings. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28device: do not clear keys during sleep on AndroidJason A. Donenfeld
This makes sense for the security model of laptops, but not for clicking phones on and off, where we actually want to be able to handle incoming packets. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28curve25519: explictly depend on AS_AVXJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28compat: support RAP in assemblyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-28curve25519: modularize dispatchJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-27qemu: take shared lock for untarringJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-26blake2s: tweak avx512 codeSamuel Neves
This is not as ideal as using zmm, but zmm downclocks. And it's not as fast single-threaded as using the gathers. But it is faster when multithreaded, which is what WireGuard is doing. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-26compat: support 4.15's netlink and barrier changesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25allowedips: simplifyJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25allowedips: optimizeJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-25qemu: use netfilter.org https siteJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23chacha20: directly assign constant and initial stateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23compat: fix typo and rangesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-23tools: fix removing preshared keysJason A. Donenfeld
Also clean up related logic quite a bit and add unit tests. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: support AVX512BW+VL by lyingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22blake2s: hmac space optimizationSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22blake2s: AVX512F+VL implementationSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305-avx512: requires AVX512F+VL+BWSamuel Neves
Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: support timespec64 on old kernelsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: poly cleans up its own stateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305-x86_64: unclobber %rbpSamuel Neves
OpenSSL's Poly1305 kernels use %rbp as a scratch register. However, the kernel expects rbp to be a valid frame pointer at any given time in order to do proper unwinding. Thus we need to alter the code in order to preserve it. The most straightforward manner in which this was accomplished was by replacing $d3 in poly1305-x86_64.pl -- formerly %r10 -- by %rdi, and replace %rbp by %r10. Because %rdi, a pointer to the context structure, does not change and is not used by poly1305_iteration, it is safe to use it here, and the overhead of saving and restoring it should be minimal. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22global: switch from timeval to timespecJason A. Donenfeld
This gets us nanoseconds instead of microseconds, which is better, and we can do this pretty much without freaking out existing userspace, which doesn't actually make use of the nano/micro seconds field: zx2c4@thinkpad ~ $ cat a.c void main() { puts(sizeof(struct timeval) == sizeof(struct timespec) ? "success" : "failure"); } zx2c4@thinkpad ~ $ gcc a.c -m64 && ./a.out success zx2c4@thinkpad ~ $ gcc a.c -m32 && ./a.out success This doesn't solve y2038 problem, but timespec64 isn't yet a thing in userspace. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22poly1305: import MIPS64 primitive from OpenSSLJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: import ARM primitives from OpenSSLJason A. Donenfeld
ARMv4-ARMv8, with NEON for ARMv7 and ARMv8. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: import x86_64 primitives from OpenSSLSamuel Neves
x86_64 only at the moment. SSSE3, AVX, AVX2, AVX512. Signed-off-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22chacha20poly1305: add more test vectors, some of which are weirdJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: new kernels have netlink fixesJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-22compat: stable finally backported fixJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-17qemu: use unprefixed strip when not cross-compilingJason A. Donenfeld
Fedora/Redhat doesn't ship with a prefixed strip, and we don't need to use it anyway when we're not cross compiling, so don't. Reported-by: Samuel Neves <sneves@dei.uc.pt> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-17device: uninitialize socket first in destructionJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-17socket: only free socket after successful creation of newJason A. Donenfeld
When an interface is down, the socket port can change freely. A socket will be allocated when the interface comes up, and if a socket can't be allocated, the interface doesn't come up. However, a socket port can change while the interface is up. In this case, if a new socket with a new port cannot be allocated, it's important to keep the interface in a consistent state. The choices are either to bring down the interface or to preserve the old socket. This patch implements the latter. Reported-by: Marc-Antoine Perennou <keruspe@exherbo.org> Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-14compat: fix compilation with PaXJason A. Donenfeld
Despite not having access to the latest grsecurity source, I still do very much want to keep supporting it, so this patch is my best guess at what will work. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-14curve25519-neon: compile in thumb modeJason A. Donenfeld
In thumb mode, it's not possible to use sp as an operand of and, so we have to muck around with r3 as a scratch register. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-14compat: 3.16.50 got proper rt6_get_cookieJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-14qemu: update kernelJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-13allowedips: do not write out of boundsJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-13selftest: allowedips: randomized test mutex updateJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-11version: bump snapshotJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-11curve25519: reject deriving from NULL private keysJason A. Donenfeld
These aren't actually valid 25519 points pre-normalization, and doing this is required to make unsetting private keys based on all zeros. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10allowedips: rename from routingtableJason A. Donenfeld
Makes it more clear that this _not_ a routing table replacement. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10netlink: make sure we reserve space for NLMSG_DONEJason A. Donenfeld
Otherwise, if messages pack really close together, we'll exceed the size of the sk_buff and return ENOBUFS. I suspect this has been the cause of a lot of weird bugs that people just worked around by increasing the receive buffer size. This actually addresses the root cause. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10compat: 4.4.0 has strange ECN functionJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10qemu: bump kernel versionJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10receive: hoist fpu outside of receive loopJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10qemu: more debuggingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10device: wait for all peers to be freed before destroyingJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
2017-11-10qemu: check for memory leaksJason A. Donenfeld
Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>