7 ms·
WireGuarding the mainline
- mirimir 8y agoQuoting Linus Torvalds:[0] > I see that Jason actually made the pull request to have wireguard included in the kernel. > Can I just once again state my love for it and hope it gets merged soon? Maybe the code isn't perfect, but I've skimmed it, and compared to the horrors that are OpenVPN and IPSec, it's a work of art. 0) https://lwn.net/ml/linux-kernel/CA+55aFz5EWE9OTbzDoMfsY2ez04Qv9eg0KQhwKfyJY0vFvoD3g@mail.gmail.com/ https://lwn.net/ml/linux-kernel/CA+55aFz5EWE9OTbzDoMfsY2ez04... Edit: fixed URL
- mberning 8y agoAn incredible compliment to be sure.
- deelowe 8y agoBut in true Linus style, he just has to take a dig at another team at the same time to balance things out.
- draw_down 8y agoI think it's okay for him to be frank about things. We all don't like when he bites someone's head off; fine, that's not what he's doing here. We're really at a point where people would prefer to discuss his tone rather than the content of what he says, even here.
- deelowe 8y agoThat's because he can't make a single comment on a thread without at least throwing a least a couple of backhanded insults in there.
- mirimir 8y agoSure. But isn't it a valid dig?
- deelowe 8y agoI don't know. I'm sure the teams working on their tools had their reasons.
- swsieber 8y agoThere are reasons to have technical debt. Having reasonable reasons don't make the technical debt any easier to fix. I don't think Linus' comment was directed at the author, it was at the code. Whatever the reason, the code he took a dig at is messier than wireguard.
- ryanlol 8y agoYou mean, each individual member of those teams had their reasons?
- deelowe 8y agoNot sure. I'm not on the team, but I seriously doubt their intent was to write bad software. I know before ipsec existed there was nothing, so why not thank the individuals who worked on it for pioneering the effort in the first place?
- foresto 8y agoTo be fair, his comment was not directed at another team, but at another body of code. (Two, actually.) The context makes it not merely a dig, but constructive feedback: "Those past projects have significant flaws, and here we have an example of how to do it right." If I were an OpenVPN or IPSec developer, I think I'd swallow my pride and take this valuable opportunity to learn how to improve my work.
- viraptor 8y agoOr specifically as whole systems with multiple implementations. There's no "IPsec" code really.
- pfranz 8y agoThat's great to hear, but I wonder if anyone has insight on the rest of the article. Is this Zinc API a prerequisite for WireGuard to be included? Is the fact that Zinc won't support hardware encryption a no-go or is the expectation they give reasonable? Has the kernel had any large API refactoring similar the crypto/Zinc (I would assume it has)--how did they play out?
- caf 8y agoThere seems to be broad agreement for the need for a set of software crypto implementations with a straightforward synchronous, static dispatching API. The discussions seem to be mainly around code organisation and plumbing that API as an underlying implementation used by the dynamic dispatch asynchronous crypto API.
- zx2c4 8y agoRight. So basically v2 of the Zinc patchset will address the nice points brought up on the list, and I think things should proceed nicely.
- rurban 8y agoJason: Any word on the name yet? My concern is the confusion with the existing my minizinc and flatzinc project, a standard constraint modeling language, which has nothing to do with crypto. There should be some better name for the Linux crypto lib.
- majewsky 8y agoSo what? Name clashes happen all the time. Before seeing this comment, I had never heard of minizinc and flatzinc. In fact, if you had asked me if Zinc clashes with anything, I'd have thought of Tinc (which is a VPN product, so roughly in the same space).
- jwilk 8y agoFixed link: https://lwn.net/ml/linux-kernel/CA+55aFz5EWE9OTbzDoMfsY2ez04Qv9eg0KQhwKfyJY0vFvoD3g@mail.gmail.com/ https://lwn.net/ml/linux-kernel/CA+55aFz5EWE9OTbzDoMfsY2ez04...
- mirimir 8y agoThanks :) I'm not sure how that happened.
- ghayes 8y agoOff topic: Does anyone have a good tutorial on setting up Wiregaurd on a cloud server to act as a VPN? I’m currently using Algo from Trail of Bits, which is great, but takes a lot on control out of my hands through its Ansible scripts.
- zwily 8y agohttps://github.com/StreisandEffect/streisand https://github.com/StreisandEffect/streisand will do WireGuard.
- iampims 8y agohttps://www.timdoug.com/log/2018/08/04/#wireguard_macos https://www.timdoug.com/log/2018/08/04/#wireguard_macos https://www.stavros.io/posts/how-to-configure-wireguard/ https://www.stavros.io/posts/how-to-configure-wireguard/ should be sufficient to help you set it up.
- bubblethink 8y agoOfficial documentation and the arch wiki (https://wiki.archlinux.org/index.php/WireGuard https://wiki.archlinux.org/index.php/WireGuard) are good sources
- mirimir 8y agoOthers have posted great links. But one great aspect is how simple it is. The hardest part is getting a kernel module that works with your kernel. In my experience, the best way to do that is to build it. And that's the hardest part in getting WireGuard working. In Debian, that means using the latest stable release (at least) with the latest kernel. Once you have WireGuard working, creating tunnels is utterly trivial. For a toy implementation: peer 0 with IPv4 address 1.2.3.4 # ip link add dev wg0 type wireguard # ip link list [see wg0] # wg genkey | tee privatekey | wg pubkey > publickey # mkdir wg # mv privatekey publickey ./wg/ # ip address add dev wg0 10.0.10.1 peer 10.0.10.2 # wg set wg0 listen-port 51820 private-key ~/wg/privatekey # ip link set wg0 up # wg interface: wg0 public key: 0GS...0U= private key: (hidden) listening port: 51820 # wg set wg0 peer IlC...QI= allowed-ips 0.0.0.0/0 endpoint 6.7.8.9:51820 peer 1 with IPv4 address 6.7.8.9 # ip link add dev wg0 type wireguard # ip link list [see wg0] # wg genkey | tee privatekey | wg pubkey > publickey # mkdir wg # mv privatekey publickey ./wg/ # ip address add dev wg0 10.0.10.2 peer 10.0.10.1 # wg set wg0 listen-port 51820 private-key ~/wg/privatekey # ip link set wg0 up # wg interface: wg0 public key: IlC...QI= private key: (hidden) listening port: 51820 # wg set wg0 peer 0GS...0U= allowed-ips 0.0.0.0/0 endpoint 1.2.3.4:51820
- microcolonel 8y ago> Andy Lutomirski was generally favorable as well, noting that he has tried to carry out some similar changes to the cryptographic code in the past. Support for hardware accelerators should, he said, be built on top of Zinc; code needing that support could then use the more complex API that would be required, and the Zinc implementations could be used as fallbacks when acceleration is not available or practical to use. This seems like a flawless approach. The Zinc approach seems to be preferred (by those involved) for simple software-only use cases, and the more complex use cases seem to be composed of operations which Zinc could implement. It's good that they're not just going to plop the thing in there in a degraded state (with probably worse performance [and DoS resistance] than the current out of tree/dkms distributions of wireguard).
- zx2c4 8y ago> It's good that they're not just going to plop the thing in there in a degraded state (with probably worse performance [and DoS resistance] than the current out of tree/dkms distributions of wireguard). Yea, indeed, I'm really trying to get the mainline version to have the same performance and security characteristics as the out-of-tree module version. (And after it's mainlined, the out-of-tree module will only exist as compatibility for older kernels, and I'll have some scripts to automatically extract a mainline kernel into a backport.)
- pingec 8y agoWireguard looks awesome. Any news about a windows wireguard implementation?
- kbaker 8y agoThere's TunSafe, BUT with caveats: https://news.ycombinator.com/item?id=16515637 https://news.ycombinator.com/item?id=16515637
- ludde 8y agoTunSafe is Open Source nowadays so most of those caveats are moot.
- zx2c4 8y agoI still believe TunSafe's interoperability and standing security issues are significant, and that TunSafe's existence and confusion-potential are generally damaging to the WireGuard project, as has been the adversarial position of their developer. That project is going in a number of really undesirable directions from a security perspective. I would encourage folks to stay away from this software. For those who are after Windows clients, the WireGuard project will hopefully have one quite soon, and of course we're happy to work with interested Windows developers who are working on similar projects with a security-minded attitude. --- I'm sure the subsequent replies to this message will have plenty of outcry, demands for details, misinformation, and accusations, to bait this into a long sprawling thread. I'd like to preemptively step out of that kind of mudslinging. But I do think it's important to warn users, hence the note above.
- mmozeiko 8y agoWhat are the current security issues with TunSafe?
- nostream 8y agoSo far, I have not heard anyone who has found any security holes and I'm active in the #WireGuard IRC channel with 300+ users, where many have looked at the code. There may be some unscrupulous hacker who has reviewed the code and found something but choose not to publish it, but it may also apply to WireGuard's source code. A security hole in WireGuard's wg-quick that many use to establish the connection is that it allows the .conf file to download and execute programs without asking the user, and this feature is enabled by default. This is basically a good feature and allows admins to run custom software as soon as the connection has been established. However, it allows an evil (or NSA-hooked) VPN provider to issue .conf files to infect the user's computer with malicious code because users of VPN services rarely review the .conf files. TunSafe has the same feature but it is disabled by default and requires Admin privileges to enable it. I like that TunSafe seems to have more restrictive security settings as default, though it may not be appreciated by hardcore users.
- nickpsecurity 8y ago"He pointed out that Zinc cannot support hardware cryptographic accelerators, something that Donenfeld regards as a feature. " Why is not supporting hardware acceleration a feature? Or is the objection to something more specific having to do with currently-available accelerators?
- evil-olive 8y agoThe idea is that hardware acceleration is a niche feature, so it should be kept out of the core, low-level crypto primitives, and then a higher-level API can be built that allows dynamic dispatch to an accelerator if available: https://lkml.org/lkml/2018/8/3/15 https://lkml.org/lkml/2018/8/3/15 > A very large majority of in-kernel crypto users (by number of call sites under a very brief survey, not by number of CPU cycles) just want to do some synchronous crypto on a buffer that is addressed by a regular pointer. Most of these users would be slowed down if they used any form of async crypto, since the CPU can complete the whole operation faster than it could plausibly initiate and complete anything asynchronous. And, right now, they suffer the full overhead of allocating a context (often with alloca!), looking up (or caching) some crypto API data structures, dispatching the operation, and cleaning up. > So I think the right way to do it is to have directly callable functions like zinc uses and to have the fancy crypto API layer on top of them. So if you actually want async accelerated crypto with scatterlists or whatever, you can call into the fancy API, and the fancy API can dispatch to hardware or it can dispatch to the normal static API.
- nickpsecurity 8y agoThat makes sense. Thanks!
- floatboth 8y agoI guess they don't count CPU instruction based accelerators like AES-NI as accelerators?
- geertj 8y agoCorrect
- efiecho 8y agoI'm really looking forward to start experimenting with Wireguard. Jason A. Donenfeld is also the creator of my favorite password manager https://www.passwordstore.org/ https://www.passwordstore.org/ and recently I found a neat web frontend for git called cgit, lo and behold, when I looked it up I saw that Jason was the creator. He makes some really cool high quality stuff.
- Boulth 8y ago> He makes some really cool high quality stuff. Couldn't agree more, all of his software is really nicely designed and implementated. Moreover I had a chance of exchanging emails with him and he's a really nice person.
- tptacek 8y agoHe really is. We just got done hanging out with him at Black Hat, and he's one of the nicer people I've met here. A+++ would hang out again.
- andreareina 8y agoDoes anyone know why reverse christmas tree order of declarations (i.e. longest to shortest line length) is part of the style guide?
- hinkley 8y agoI’m wondering that too. What happens when a variable is initialized as a consequence of the state of two other variables (which would tend to be a longer statement)?
- catwell 8y agoI don't know in their case, but I know it's the style used by Hisham Muhammad (author of htop and LuaRocks among other things), and he explained why here: https://hisham.hm/2018/06/16/when-listing-repeated-things-make-pyramids/ https://hisham.hm/2018/06/16/when-listing-repeated-things-ma...
- Animats 8y agoThat this has to be in the kernel is a failure of the Linux architecture. This is middleware.
- tptacek 8y agoSure. It is middleware in the same sense that an encrypted filesystem is middleware.
- catwell 8y agoThe only reason for it to be in the kernel is performance. There are userspace implementations already, like on Windows and macOS.
- rwmj 8y agoBecause everyone knows kernel code runs faster than userspace code, right? Er no, because of architectural problems.
- catwell 8y agoIf you're going to argue this then I agree with tptacek, you must also think it's an architectural problem that filesystems cannot all be implemented over FUSE with performance equivalent to their kernel versions. Yes, TUN is not 0-copy. Is there an equivalent that's as fast as the kernel in any other major OS? (I'm asking that honestly, I have no idea.) If there is, is in-kernel networking on that OS as fast as on Linux? The Linux network stack is what it is, there have been recent improvements for it (e.g. DPDK), but I think it must not be so bad given it powers most of the Internet.
- rwmj 8y agoIt doesn't have to be "over FUSE". There are microkernels out there like QNX and L4 which solve the filesystem in userspace problem, are extremely fast, and have done this for decades. You likely have a realtime L4 instance in your phone doing the real work talking to the phone network. Heck even my Nintendo Switch has a simple microkernel OS, with an unspectacular ARM processor, and it runs games - one of the most performance sensitive applications that regular people use.
- chrisper 8y agoDoes anyone know a good Windows client? I only know TunSafe, which now has finally been open sourced. But it was still controversial software. So any alternative would be nice.
- nostream 8y agoI've never really understood what was controversial with TunSafe more than it was closed source so it was hard for others to review the code, but now it's open source. As a former fan of WireGuard, I would STRONGLY advise against using ANY WireGuard implementation and that includes the official one. As it is now, there seems to be only one person in the world who believes that they have the knowledge to determine if a WireGuard implementation is secure or not, and it is the founder himself. So much for the 4000 lines of code that was supposed to be easily audited and understandable by others. Avoid WireGuard until there is an outside group that can review the protocol and implementations of the protocol. For as it is now, the founder accuses all third party implementations of being unsecure but without being able to state why (more than it feels he has something personal against them). It all feels too immature.
- pimeys 8y agoA couple of days ago I started testing with WireGuard and installed it to my Omnia Turris router. Mullvad provides WireGuard servers[0] for testing with a reasonable price, and I've been routing all the traffic from our apartment through WireGuard without any problems. The speed is just amazing after seeing the disappointing performance of OpenVPN, I can easily push 300-400 MB/s through the router, finally removing the last reason to not use a VPN for all the traffic. [0] https://mullvad.net/en/guides/category/wireguard/ https://mullvad.net/en/guides/category/wireguard/
- Kurtz79 8y agoWhat is the status of WireGuard in terms of client device support? The main advantage of IPsec and OpenVPN is that they are either natively supported by all major OSs (desktop and mobile) or there are apps freely available for that purpose.
- chupasaurus 8y agoLinux, Android and macOS (through brew app) are supported, Windows and iOS clients are in development.
- deleted 8y ago[deleted]