81 points · by cperciva · 15y ago · 30 comments
A one-line comment in "Security requirements", or even an option to read from /dev/random, may be a good idea.
I tried compiling it on OpenBSD; you should probably #include <string.h> in lib/events/events_network.c for memset() as used in FD_ZERO (see OpenBSD select(2)). OpenBSD has no -lrt either, so I just removed that. It compiles and passes a quick localhost test with these changes.
Good point. I'm used to FreeBSD, where /dev/urandom and /dev/random are the same device.
you should probably #include <string.h> in lib/events/events_network.c for memset() as used in FD_ZERO
POSIX says that <sys/select.h> is all you need.
OpenBSD has no -lrt either, so I just removed that.
POSIX says that -lrt must work (having a librt isn't required, but if you don't have one the compiler must ignore -lrt).
Hopefully these will either get fixed in OpenBSD or as patches in ports/security/spiped if someone decides to add spiped to the OpenBSD ports tree.
The reality here, and I think you should just come out and say it, is that the rationale behind spiped is that you don't trust SSL/TLS period.
What's the deal with the per-message padding scheme here? Is this a tradeoff against rekeying?
That's part of it, sure. But SSL/TLS also doesn't provide client authentication (unless you use client SSL keys, which is absolutely guaranteed to have security holes given that nobody ever uses them).
What's the deal with the per-message padding scheme here?
1. Makes the code much simpler and less error-prone (no need to read variable-length records from the network).
2. Cuts down on information leakage. I'm planning on using this for kivaloo, which uses variable-length records -- I don't want to expose the lengths of account names or suchlike.
Considering that a pointer mistake in code that you didn't think was security critical might allow execution of arbitrary code, aren't all code paths that might execute, security critical?
I used to use ssh tunnels for tunneling irc from irssi-proxy to my local machine (since I don't trust irssi's authentication around the proxy). This involved several steps: binding the proxy to 127.0.0.1, and then sshing in from my desktop and forwarding the ports. And, with two transport layers, my irc client would disconnect if the irc connection failed or if the ssh connection failed. This was annoying.
I eventually switched to OpenVPN. I run a server on one of my hosts, and then the other networks I control connect to that and share their networks. The result is that I can bind irssi-proxy to the 10.0.42.0 interface and then directly connect from any other machine on my network.
This ends up being much less of a pain than the other setup, scales to many more services, and lets me do cool things like ssh-ing to my phone when it's on Sprint's network and my laptop is on a cafe's network.
(Oh, and if you do this yourself, don't use anything in 10.0.0.0/16 for your internal network; VPN or otherwise. You will end up in some coffee shop that reserves the whole /16 for itself when all it needs is some random /8, and then nothing works.)
Second, if all you're trying to do is hook one discrete component up to another, a full-on VPN isn't just overkill, it's also unnecessarily dangerous, since now you have to configure the network stacks to ensure that only the traffic you intended to allow is going to be able to get through after a minor compromise.
What could possibly go wrong?
I didn't reach any conclusion from my quick look, but was definitely put off by the "it's big so it must be insecure" view taken by the author.
spiped is because it's dumb to do asymmetric crypto when you can establish a pre-shared key.
I have a question though - in the beginning of your post, you talk about STUD. Did you replace stunnel with STUD, or not just yet? Just wondering how that went.
Not yet. That's waiting for the next time I context-switch into sysadmin mode.
One thing this could be useful for is using a public server as a proxy to connect from a box behind a NAT to a box behind a different NAT. So you run spiped on the server and manually connect from client 1 to the server. Then you can SSH or VNC into client 1 from client 2 via the server. I wouldn't like to set this up using OpenSSH, but with spiped this seems easy.
# smtp server
socat OPENSSL-LISTEN:8025,reuseaddr,fork,cert=$CERT,key=$KEY,cafile=$CAFILE TCP:127.0.0.1:25
# smtp client
socat TCP-LISTEN:25,reuseaddr,fork OPENSSL-CONNECT:$SERVERNAME:8025,cert=$CERT,key=$KEY,cafile=$CAFILE