|
libobstcp
The core library
The core library is called libobstcp and it's built as a shared library. Everything else depends on this and so you should install it first. You can get the source code from the git repo or download the tarball. A simple make, make install should do it. You'll need development headers for libevent to build some of the code (but not the core). % make gcc -ggdb -fPIC -Wall -fvisibility=hidden -c libobstcp.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c salsa20-merged.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c sha256.c libobstcp.c:32: warning: ‘print_bytes’ defined but not used gcc -ggdb -fPIC -Wall -fvisibility=hidden -c base64.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c curve25519-donna-x86-64.c -Wall cpp curve25519-donna-x86-64.s > curve25519-donna-x86-64.s.pp as -o curve25519-donna-x86-64.s.o curve25519-donna-x86-64.s.pp ar -rc libobstcp.a libobstcp.o salsa20-merged.o sha256.o curve25519-donna-x86-64.o curve25519-donna-x86-64.s.o base64.o gcc -o libobstcp.so.1 -shared -Wl,-soname -Wl,libobstcp.so.1 -ldl libobstcp.o salsa20-merged.o sha256.o base64.o curve25519-donna-x86-64.o curve25519-donna-x86-64.s.o gcc -ggdb -fPIC -Wall -fvisibility=hidden -o obstcp-serv obstcp-serv.c libobstcp.a gcc -ggdb -fPIC -Wall -fvisibility=hidden -o obstcp-cli obstcp-cli.c libobstcp.a gcc -ggdb -fPIC -Wall -fvisibility=hidden -o obstcp-redir obstcp-redir.c libobstcp.a -levent gcc -ggdb -fPIC -Wall -fvisibility=hidden -o obstcp-keygen obstcp-keygen.c libobstcp.a % sudo make install [sudo] password for agl: cp libobstcp.h /usr/include cp libobstcp.so.1 /usr/lib ln -sf /usr/lib/libobstcp.so.1 /usr/lib/libobstcp.so ldconfig TODOIn no order:
ToolsThe library includes several tools: obstcp-serv: An obstcp server. Just run it and it'll print a random port number and advert for the new server. Connect using obstcp-cli and you can exchange lines via stdin and stdout. obstcp-cli: An obstcp client. Give it an IP address and an advert string on the command line. obstcp-keygen: generates a private key (which is written to stdout) and an advert (written to stderr). Give it a port number on the command line. obstcp-redir: A proxy for a TCP server. You can hide webservers (for example) behind this to make them support obstcp. It accepted obfuscated connections on a given port and forwards the connection to an IP:port pair. |
Sign in to add a comment
I was unsuccessful at compiling on a Mac. See the error output below:
@matt.martini: thanks for the report. That's very helpful - I OS X doesn't define ENOKEY, but does define a standard function already called encrypt. I'll fix both in the next couple of days.
@matt.martini: those two issues should be fixed in the git tree with commits afb885fa3a6072ce6d624af38b4b4a85d0ca09f2 and 1b50458286542e3489d64f6fb57144c51596d1bf. Thanks!
Ok, that helped but now I get:
@matt.martini: looks like all the curve25519 implementations are failing to build. They should cover x86-64, x86 and any 64-bit capable GCC. Have you a CPU outside that set?
Trying to get this working, I compiled and got the following: sleep 7 touch .warning gcc -ggdb -fPIC -Wall -fvisibility=hidden -c libobstcp.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c salsa208.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c sha256.c gcc -ggdb -fPIC -Wall -fvisibility=hidden -c base32.c /bin/bash -c 'cd curve25519 && exec /bin/bash buildone.sh' Trying donna x.s: Assembler messages: x.s:41: Error: bad register name `%rbx' x.s:42: Error: bad register name `%r12' x.s:43: Error: bad register name `%r13' x.s:44: Error: bad register name `%r14' x.s:45: Error: bad register name `%r15' x.s:46: Error: bad register name `%rdi' x.s:50: Error: bad register name `%rsi' x.s:51: Error: bad register name `%rcx)' -- followed by a couple hundred lines of "bad register name"
Then I started the server: obstcp-serv and got a port (60829)and a server advert 108...2p5
Then I opened another terminal window and started the client with obstcp-cli 127.0.0.1 advert#
and keep getting:
any advice?
Thanks
Got the same error as matt. Had to strip out the -fvisibility=hidden option, since it is not recognized by the compiler (using gcc 3.4.4 on a cygwin shell). Using the last commited version. Here's the stack:
Sorry, my mistake - using the last tarball. Got the code from the tree; this error is gone, but got a new one. Here's the complete stack:
Any ideas?
Thanks
UPdate. tried a few more times and got further. Started server with root@adtim-laptop:~/Downloads/libobstcp-0.3.2# ./obstcp-serv port: 42072 advert: 108g3k66dk0rw6wk4jqbqt3g7b8umc7hpn5xnzxqbv6fuujv5psjdcx0209k5
started client with
got "remote closed"
and server session said: accepted connection obstcp_rbuf_read_fd: Resource temporarily unavailable
note that it was after a restart of the OS (Ubuntu 8.04) that the client started working. That is the only thing I can think of that changed.
@ tim.e.mcguire: The warnings about the registers are expected on any non 64-bit Intel CPU. The build tries several implementations (for different CPUs) and selects the best that works. Possibly I should just hide the output in the future.
When you get "Usage: ./obstcp-cli <destination ip> <server advert>" that should mean that either the wrong number of arguments were given or the IP address didn't parse. The arguments are broken up by the shell, so it's possible that something odd is happening there. Often one can quote arguments with 'xyz' to stop a shell from breaking in the wrong place.
What platform (OS, CPU, GCC version) are you using?
The "Resource temporarily unavailable" is very odd. That's known as EAGAIN, which should only happen on non-blocking sockets and only obstcp-redir sets any sockets to be non-blocking.
I might know more when I know the platform.
Thanks for testing!
OS = Ubuntu Hardy. 8.0.4 NOT the 64bit edition. CPU = Intel(R) Core(TM)2 Duo CPU T7300 @ 2.00GHz
gcc-4.2Is it possible that the 32bit version of ubuntu running on a 64bit hardware is the issue?
@tim.e.mcguire: Well, it's a real OS, so I'm at a loss I'm afraid. Can you run the programs under strace and send me the output? (strace -o /tmp/output ./obstcp-...). Thanks.
(You might wish to switch to email since the output is probably quite large. I also pay more attention to email! agl at imperialviolet dot org)
Cheers
AGL