tinc
12 years agoMake sure the ReplayWindow option works for SPTPS as well.
Guus Sliepen [Sun, 14 Oct 2012 12:48:35 +0000 (14:48 +0200)]
Make sure the ReplayWindow option works for SPTPS as well.

12 years agoOnly log success of initial datagram SPTPS handshake.
Guus Sliepen [Sun, 14 Oct 2012 12:45:27 +0000 (14:45 +0200)]
Only log success of initial datagram SPTPS handshake.

12 years agoFix handling of initial datagram SPTPS packet.
Guus Sliepen [Sun, 14 Oct 2012 12:33:54 +0000 (14:33 +0200)]
Fix handling of initial datagram SPTPS packet.

Only the very first packet of an SPTPS session should be send with REQ_KEY,
this signals the peer to abort any previous session and start a new one as
well.

12 years agosptps.c: Add missing newline to log message.
Sven-Haegar Koch [Fri, 12 Oct 2012 15:08:01 +0000 (17:08 +0200)]
sptps.c: Add missing newline to log message.

12 years agoStrip newline from incoming SPTPS requests.
Guus Sliepen [Thu, 11 Oct 2012 20:47:13 +0000 (22:47 +0200)]
Strip newline from incoming SPTPS requests.

Most of the code doesn't care whether requests are terminated with a newline or
not, except that when requests are forwarded, it is assumed they do not have
one and a newline is added.  When a node using SPTPS receives a request from
another SPTPS-using node, and forwards it to a non-SPTPS-using node, this will
result in two consecutive newlines, which the latter node will see as an empty,
and thus invalid, request.

12 years agoClear status and options fields of unreachable nodes.
Guus Sliepen [Thu, 11 Oct 2012 20:21:30 +0000 (22:21 +0200)]
Clear status and options fields of unreachable nodes.

12 years agoFix whitespace.
Guus Sliepen [Wed, 10 Oct 2012 15:17:49 +0000 (17:17 +0200)]
Fix whitespace.

12 years agoTry all known addresses of node during the PMTU discovery phase.
Guus Sliepen [Wed, 10 Oct 2012 12:46:22 +0000 (14:46 +0200)]
Try all known addresses of node during the PMTU discovery phase.

This helps in situations where some nodes have IPv6 and others have not.

12 years agoFix hash functions for keys whose size is not divisible by 4.
Guus Sliepen [Tue, 9 Oct 2012 15:49:09 +0000 (17:49 +0200)]
Fix hash functions for keys whose size is not divisible by 4.

12 years agoFix memory leaks found by valgrind.
Guus Sliepen [Tue, 9 Oct 2012 14:27:28 +0000 (16:27 +0200)]
Fix memory leaks found by valgrind.

12 years agoClear Ethernet header when reading packets from a tun device.
Guus Sliepen [Tue, 9 Oct 2012 13:52:58 +0000 (15:52 +0200)]
Clear Ethernet header when reading packets from a tun device.

This fixes a warning from valgrind about uninitialized bytes, which were being
sent to other nodes.

12 years agoRemove unused variables, fix some #includes.
Guus Sliepen [Tue, 9 Oct 2012 11:28:09 +0000 (13:28 +0200)]
Remove unused variables, fix some #includes.

12 years agoFix deleting connections from the connection list.
Guus Sliepen [Tue, 9 Oct 2012 11:23:12 +0000 (13:23 +0200)]
Fix deleting connections from the connection list.

12 years agoC99 extravaganza.
Guus Sliepen [Sun, 7 Oct 2012 22:35:38 +0000 (00:35 +0200)]
C99 extravaganza.

12 years agoReplace the connection_tree with a connection_list.
Guus Sliepen [Sun, 7 Oct 2012 19:59:53 +0000 (21:59 +0200)]
Replace the connection_tree with a connection_list.

The tree functions were never used on the connection_tree, a list is more appropriate.
Also be more paranoid about connections disappearing while traversing the list.

12 years agoRefactor outgoing connection handling.
Guus Sliepen [Sun, 7 Oct 2012 19:02:40 +0000 (21:02 +0200)]
Refactor outgoing connection handling.

Struct outgoing_ts and connection_ts were depending too much on each other,
causing lots of problems, especially the reuse of a connection_t. Now, whenever
a connection is closed it is immediately removed from the list of connections
and destroyed.

12 years agoFix warnings from cppcheck.
Guus Sliepen [Sun, 7 Oct 2012 15:53:23 +0000 (17:53 +0200)]
Fix warnings from cppcheck.

12 years agoRemove a debug message.
Guus Sliepen [Sun, 7 Oct 2012 12:06:47 +0000 (14:06 +0200)]
Remove a debug message.

12 years agoHandle packets encrypted via SPTPS that need to be forwarded via TCP.
Guus Sliepen [Sun, 7 Oct 2012 12:03:50 +0000 (14:03 +0200)]
Handle packets encrypted via SPTPS that need to be forwarded via TCP.

12 years agoMake datagram SPTPS key exchange more robust.
Guus Sliepen [Sun, 7 Oct 2012 11:31:19 +0000 (13:31 +0200)]
Make datagram SPTPS key exchange more robust.

Similar to old style key exchange requests, keep track of whether a key
exchange is already in progress and how long it took. If no key is known yet
or if key exchange takes too long, (re)start a new key exchange.

12 years agoUseful error messages when writing to a meta connection fails.
Guus Sliepen [Sun, 7 Oct 2012 09:45:54 +0000 (11:45 +0200)]
Useful error messages when writing to a meta connection fails.

12 years agoWhen terminating, keep control connections open until the end.
Guus Sliepen [Sat, 6 Oct 2012 19:16:17 +0000 (21:16 +0200)]
When terminating, keep control connections open until the end.

This ensures all device files and listening sockets have been closed before
tincctl gets notified of tincd's termination.

12 years agoClear connection options and status fields in free_connection_partially().
Guus Sliepen [Sat, 6 Oct 2012 19:15:19 +0000 (21:15 +0200)]
Clear connection options and status fields in free_connection_partially().

Most fields should be zero when reusing a connection. In particular, when an
outgoing connection to a node which is reachable on more than one address is
made, the second connection to that node will have status.encryptout set but
outctx will be NULL, causing a NULL pointer dereference when
EVP_EncryptUpdate() is called in send_meta() when it shouldn't.

12 years agoImprove starting/stopping tincd using tincctl.
Guus Sliepen [Sat, 6 Oct 2012 15:45:03 +0000 (17:45 +0200)]
Improve starting/stopping tincd using tincctl.

When starting tincd, tincctl now strips non-options from the command line, and
sets argv[0] to the name of the tincd command instead of copying its own
command name.

When stopping a running tincd, tincctl now waits for it to terminate.

12 years agoFix off-by-one error.
Guus Sliepen [Sat, 6 Oct 2012 14:53:43 +0000 (16:53 +0200)]
Fix off-by-one error.

Apart from writing 1 byte beyond an array allocated on the stack, this slipped
an unitialized byte in the seed used for key generation.

12 years agoLibreadline might depend on libcurses.
Guus Sliepen [Mon, 1 Oct 2012 08:42:13 +0000 (10:42 +0200)]
Libreadline might depend on libcurses.

12 years agoRemove abort() call that accidentily sneaked into commit dd1b69e.
Guus Sliepen [Mon, 1 Oct 2012 08:39:15 +0000 (10:39 +0200)]
Remove abort() call that accidentily sneaked into commit dd1b69e.

12 years agoMake sure sptps_test compiles without -flto.
Guus Sliepen [Mon, 1 Oct 2012 08:36:23 +0000 (10:36 +0200)]
Make sure sptps_test compiles without -flto.

12 years agoRemove unused function declaration.
Guus Sliepen [Sun, 30 Sep 2012 21:12:43 +0000 (23:12 +0200)]
Remove unused function declaration.

12 years agoFix not reading Port statement from host config file.
Guus Sliepen [Sun, 30 Sep 2012 20:43:48 +0000 (22:43 +0200)]
Fix not reading Port statement from host config file.

12 years agoMerge branch 'master' into 1.1
Guus Sliepen [Sun, 30 Sep 2012 13:00:47 +0000 (15:00 +0200)]
Merge branch 'master' into 1.1

Conflicts:
lib/utils.c
src/net_setup.c
src/process.c
src/protocol_auth.c
src/protocol_key.c
src/utils.h

12 years agoAdd strict checks to hex to binary conversions.
Guus Sliepen [Sun, 30 Sep 2012 11:45:47 +0000 (13:45 +0200)]
Add strict checks to hex to binary conversions.

The main goal is to catch misuse of the obsolete PrivateKey and PublicKey
statements.

12 years agoAttribution for Martin Schürrer.
Guus Sliepen [Sun, 30 Sep 2012 11:45:39 +0000 (13:45 +0200)]
Attribution for Martin Schürrer.

12 years agoOutput details of encryption errors
Martin Schürrer [Sun, 30 Sep 2012 00:04:55 +0000 (02:04 +0200)]
Output details of encryption errors

12 years agoRemove some debugging messages.
Guus Sliepen [Fri, 28 Sep 2012 15:51:48 +0000 (17:51 +0200)]
Remove some debugging messages.

12 years agoMake tincctl robust against dropped control connections.
Guus Sliepen [Fri, 28 Sep 2012 15:36:25 +0000 (17:36 +0200)]
Make tincctl robust against dropped control connections.

12 years agoCorrectly add/remove outgoing connections when reloading configuration.
Guus Sliepen [Fri, 28 Sep 2012 15:05:01 +0000 (17:05 +0200)]
Correctly add/remove outgoing connections when reloading configuration.

12 years agoFix column sorting, make all lists sortable.
Guus Sliepen [Fri, 28 Sep 2012 15:03:14 +0000 (17:03 +0200)]
Fix column sorting, make all lists sortable.

12 years agoLet the GUI handle the new dump format.
Guus Sliepen [Thu, 27 Sep 2012 20:12:15 +0000 (22:12 +0200)]
Let the GUI handle the new dump format.

12 years agoFix links in documenation.
Guus Sliepen [Thu, 27 Sep 2012 15:19:02 +0000 (17:19 +0200)]
Fix links in documenation.

12 years agoFix links in documentation.
Guus Sliepen [Thu, 27 Sep 2012 15:18:49 +0000 (17:18 +0200)]
Fix links in documentation.

12 years agoComment out old public/private keys when generating new ones.
Guus Sliepen [Thu, 27 Sep 2012 13:45:02 +0000 (15:45 +0200)]
Comment out old public/private keys when generating new ones.

12 years agoUpdate documentation of the "dump graph" command.
Guus Sliepen [Wed, 26 Sep 2012 21:56:21 +0000 (23:56 +0200)]
Update documentation of the "dump graph" command.

12 years agoAllow dumping either directed or undirected graphs.
Guus Sliepen [Wed, 26 Sep 2012 21:52:36 +0000 (23:52 +0200)]
Allow dumping either directed or undirected graphs.

Internally, tinc maintains a directed graph of the meta connections between
nodes. However, this causes graphviz to draw two lines between nodes, which is
not always desirable. The "dump graph" command now defaults to dumping an
undirected graph, the "dump digraph" command will dump a directed graph.

12 years agoLet tincctl parse and format dumps.
Guus Sliepen [Wed, 26 Sep 2012 21:18:32 +0000 (23:18 +0200)]
Let tincctl parse and format dumps.

At the moment it just reproduces the old format.

12 years agoKeep last known address and time since reachability changed.
Guus Sliepen [Wed, 26 Sep 2012 20:20:43 +0000 (22:20 +0200)]
Keep last known address and time since reachability changed.

This allows tincctl info to show since when a node is online or offline.

12 years agoRemove remnants of Ethertap and old TUNSETIFF ioctl().
Guus Sliepen [Tue, 25 Sep 2012 20:28:08 +0000 (22:28 +0200)]
Remove remnants of Ethertap and old TUNSETIFF ioctl().

12 years agoFix typo in manpage.
Guus Sliepen [Tue, 25 Sep 2012 20:12:36 +0000 (22:12 +0200)]
Fix typo in manpage.

12 years agoDon't ignore Makefile.am.
Guus Sliepen [Mon, 24 Sep 2012 12:56:00 +0000 (14:56 +0200)]
Don't ignore Makefile.am.

12 years agoAttribution for Vil Brekin and some code style cleanups.
Guus Sliepen [Mon, 24 Sep 2012 12:02:07 +0000 (14:02 +0200)]
Attribution for Vil Brekin and some code style cleanups.

12 years agoAndroid cross-compilation instructions.
Vilbrekin [Sat, 25 Aug 2012 18:32:38 +0000 (20:32 +0200)]
Android cross-compilation instructions.

12 years agoUse __ANDROID__ define rather than dirty hard-code to allow android NDK cross-compila...
Vilbrekin [Sat, 25 Aug 2012 18:01:11 +0000 (20:01 +0200)]
Use __ANDROID__ define rather than dirty hard-code to allow android NDK cross-compilation.

12 years agoAdd basic .gitignore file, cleaning (most) files generated by autotools.
Vilbrekin [Sat, 25 Aug 2012 17:59:26 +0000 (19:59 +0200)]
Add basic .gitignore file, cleaning (most) files generated by autotools.

12 years agoReplace hard-code with new ScriptsInterpreter configuration property.
Vilbrekin [Sat, 25 Aug 2012 17:14:00 +0000 (19:14 +0200)]
Replace hard-code with new ScriptsInterpreter configuration property.

This new setting allows choosing a custom script interpreter used for the various tinc callbacks.
If none is specified, the script itself is called as executable (as before).
This is particularly useful when storing tinc configuration and script on a mount point with no-exec attribute.

12 years agoBasic patch for android cross-compilation.
Vilbrekin [Wed, 22 Aug 2012 08:46:24 +0000 (10:46 +0200)]
Basic patch for android cross-compilation.

Commented non-existing functions in android NDK.
Prefix scripts execution with shell binary to allow execution on no-exec mount points.
Everyything is currently hard coded, while it should use pre-compiler variables...

12 years agoEnsure sptps_test compiles with -flto.
Guus Sliepen [Thu, 13 Sep 2012 19:35:29 +0000 (21:35 +0200)]
Ensure sptps_test compiles with -flto.

12 years agoReplace node_udp_tree with a hash table.
Guus Sliepen [Wed, 5 Sep 2012 11:05:48 +0000 (13:05 +0200)]
Replace node_udp_tree with a hash table.

12 years agoUse hash tables to lookup owners of addresses.
Guus Sliepen [Wed, 5 Sep 2012 10:45:36 +0000 (12:45 +0200)]
Use hash tables to lookup owners of addresses.

12 years agoAdd a simple hash table implementation.
Guus Sliepen [Wed, 5 Sep 2012 10:44:41 +0000 (12:44 +0200)]
Add a simple hash table implementation.

12 years agoRemove newlines at end of log messages.
Guus Sliepen [Tue, 4 Sep 2012 12:21:50 +0000 (14:21 +0200)]
Remove newlines at end of log messages.

12 years agoRemove some debug messages.
Guus Sliepen [Tue, 4 Sep 2012 12:16:05 +0000 (14:16 +0200)]
Remove some debug messages.

12 years agoProperly handle SPTPS packets with stripped Ethernet headers.
Guus Sliepen [Thu, 30 Aug 2012 12:21:23 +0000 (14:21 +0200)]
Properly handle SPTPS packets with stripped Ethernet headers.

12 years agoFix node name check for "connect" and "disconnect" commands.
Guus Sliepen [Thu, 30 Aug 2012 12:00:34 +0000 (14:00 +0200)]
Fix node name check for "connect" and "disconnect" commands.

12 years agoQuit when "exit" or "quit" commands are used in tincctl's shell.
Guus Sliepen [Sun, 5 Aug 2012 15:25:31 +0000 (17:25 +0200)]
Quit when "exit" or "quit" commands are used in tincctl's shell.

12 years agoFix segfault when using tincctl's shell without readline.
Guus Sliepen [Sun, 5 Aug 2012 15:03:57 +0000 (17:03 +0200)]
Fix segfault when using tincctl's shell without readline.

12 years agoAdd bash completion script.
Guus Sliepen [Sun, 5 Aug 2012 11:50:51 +0000 (13:50 +0200)]
Add bash completion script.

12 years agoMake sure the top command can be used more than once in tincctl's shell.
Guus Sliepen [Fri, 3 Aug 2012 12:17:02 +0000 (14:17 +0200)]
Make sure the top command can be used more than once in tincctl's shell.

12 years agoFork when using the "start" command in tincctl.
Guus Sliepen [Fri, 3 Aug 2012 12:15:50 +0000 (14:15 +0200)]
Fork when using the "start" command in tincctl.

This allows the command to be given in its shell without immediatly exiting tincctl.

12 years agoAdd readline completion for tincctl config and tincctl info.
Guus Sliepen [Fri, 3 Aug 2012 11:23:07 +0000 (13:23 +0200)]
Add readline completion for tincctl config and tincctl info.

12 years agoOptionally compress and/or strip Ethernet header from SPTPS packets.
Guus Sliepen [Thu, 2 Aug 2012 15:44:59 +0000 (17:44 +0200)]
Optionally compress and/or strip Ethernet header from SPTPS packets.

12 years agoHave tincctl act as a shell when no command is given.
Guus Sliepen [Thu, 2 Aug 2012 15:24:42 +0000 (17:24 +0200)]
Have tincctl act as a shell when no command is given.

By default it uses readline to read commands. If the input and output are not a
tty, no prompt is shown.

12 years agoClear struct sptps before reusing it.
Guus Sliepen [Thu, 2 Aug 2012 15:23:51 +0000 (17:23 +0200)]
Clear struct sptps before reusing it.

12 years agoUpdate the documentation to encourage using "tincctl init" and "tincctl config".
Guus Sliepen [Wed, 1 Aug 2012 20:22:52 +0000 (22:22 +0200)]
Update the documentation to encourage using "tincctl init" and "tincctl config".

12 years agoStricter checks for netname and node names.
Guus Sliepen [Wed, 1 Aug 2012 14:51:59 +0000 (16:51 +0200)]
Stricter checks for netname and node names.

- Node names should not be empty.
- Net names should not contain slashes or start with a dot, because they are
  used in pathnames.

12 years agoAdd missing configuration variables.
Guus Sliepen [Wed, 1 Aug 2012 14:13:23 +0000 (16:13 +0200)]
Add missing configuration variables.

12 years agoAdd the ability to query configuration variables to tincctl.
Guus Sliepen [Wed, 1 Aug 2012 13:50:45 +0000 (15:50 +0200)]
Add the ability to query configuration variables to tincctl.

12 years agotincctl restart should work even if no tincd is running.
Guus Sliepen [Wed, 1 Aug 2012 13:15:37 +0000 (15:15 +0200)]
tincctl restart should work even if no tincd is running.

12 years agoTry sending SIGTERM if we cannot connect to a tincd but we know its PID.
Guus Sliepen [Wed, 1 Aug 2012 13:14:48 +0000 (15:14 +0200)]
Try sending SIGTERM if we cannot connect to a tincd but we know its PID.

12 years agoUse a status bit to track which nodes use SPTPS.
Guus Sliepen [Tue, 31 Jul 2012 19:43:49 +0000 (21:43 +0200)]
Use a status bit to track which nodes use SPTPS.

12 years agoAdd Brandon Black's replay window code to SPTPS.
Guus Sliepen [Tue, 31 Jul 2012 18:39:15 +0000 (20:39 +0200)]
Add Brandon Black's replay window code to SPTPS.

12 years agoHandle SPTPS datagrams in try_mac().
Guus Sliepen [Tue, 31 Jul 2012 18:36:35 +0000 (20:36 +0200)]
Handle SPTPS datagrams in try_mac().

12 years agoRemove unused #include.
Guus Sliepen [Tue, 31 Jul 2012 18:29:13 +0000 (20:29 +0200)]
Remove unused #include.

12 years agoUse datagram SPTPS for packet exchange between nodes.
Guus Sliepen [Mon, 30 Jul 2012 16:36:59 +0000 (18:36 +0200)]
Use datagram SPTPS for packet exchange between nodes.

When two nodes which support SPTPS want to send packets to each other, they now
always use SPTPS. The node initiating the SPTPS session send the first SPTPS
packet via an extended REQ_KEY messages. All other handshake messages are sent
using ANS_KEY messages. This ensures that intermediate nodes using an older
version of tinc can still help with NAT traversal. After the authentication
phase is over, SPTPS packets are sent via UDP, or are encapsulated in extended
REQ_KEY messages instead of PACKET messages.

12 years agoMerge branch 'master' into 1.1
Guus Sliepen [Fri, 27 Jul 2012 20:48:24 +0000 (22:48 +0200)]
Merge branch 'master' into 1.1

12 years agoAlso clarify hostnames=[yes|no] in tinc.conf(5).
Guus Sliepen [Fri, 27 Jul 2012 20:43:01 +0000 (22:43 +0200)]
Also clarify hostnames=[yes|no] in tinc.conf(5).

12 years agoMinor clarification, tinc.conf hostnames=[yes|no] variable only resolves names for...
Mesar Hameed [Tue, 24 Jul 2012 06:18:50 +0000 (07:18 +0100)]
Minor clarification, tinc.conf hostnames=[yes|no] variable only resolves names for logging purposes.

12 years agoRemove unused po/ directory.
Guus Sliepen [Sun, 22 Jul 2012 11:05:56 +0000 (13:05 +0200)]
Remove unused po/ directory.

12 years agoHave tinc-gui use same way of locating pidfile as tincd and tincctl.
Guus Sliepen [Sun, 22 Jul 2012 10:55:04 +0000 (12:55 +0200)]
Have tinc-gui use same way of locating pidfile as tincd and tincctl.

12 years agotincctl init now also creates a template tinc-up script.
Guus Sliepen [Sun, 22 Jul 2012 10:52:31 +0000 (12:52 +0200)]
tincctl init now also creates a template tinc-up script.

12 years agoFix exit code when installing tincd as a service on Windows.
Guus Sliepen [Sat, 21 Jul 2012 15:10:10 +0000 (17:10 +0200)]
Fix exit code when installing tincd as a service on Windows.

12 years agoWindows doesn't like quotes around "edit" when calling it through system().
Guus Sliepen [Sat, 21 Jul 2012 14:33:09 +0000 (16:33 +0200)]
Windows doesn't like quotes around "edit" when calling it through system().

Even though that works fine on the command line.

12 years agoUse backslashes on Windows.
Guus Sliepen [Sat, 21 Jul 2012 14:26:55 +0000 (16:26 +0200)]
Use backslashes on Windows.

Although Windows itself supports the forward slash, some programs may not.

12 years agoDon't try to mkdir(CONFDIR) on Windows when there is a registry key for tinc.
Guus Sliepen [Sat, 21 Jul 2012 13:58:16 +0000 (15:58 +0200)]
Don't try to mkdir(CONFDIR) on Windows when there is a registry key for tinc.

12 years agoFix crash when no netname is specified.
Guus Sliepen [Sat, 21 Jul 2012 13:51:15 +0000 (15:51 +0200)]
Fix crash when no netname is specified.

12 years agoFix some compiler warnings.
Guus Sliepen [Sat, 21 Jul 2012 13:50:50 +0000 (15:50 +0200)]
Fix some compiler warnings.

12 years agoHave tincd and tincctl use the same method of determining netname.
Guus Sliepen [Sat, 21 Jul 2012 13:15:04 +0000 (15:15 +0200)]
Have tincd and tincctl use the same method of determining netname.

12 years agoAdd a newline to a configuration file if it is missing.
Guus Sliepen [Sat, 21 Jul 2012 13:02:44 +0000 (15:02 +0200)]
Add a newline to a configuration file if it is missing.

12 years agoAdd some checks when changing configuration.
Guus Sliepen [Sat, 21 Jul 2012 13:02:17 +0000 (15:02 +0200)]
Add some checks when changing configuration.

12 years agoCall event_init() after detaching.
Guus Sliepen [Sat, 21 Jul 2012 12:19:23 +0000 (14:19 +0200)]
Call event_init() after detaching.

Otherwise, the call to daemon() could close filedescriptors in use by libevent
itself; for example if it uses kqueue or epoll instead of a select() or poll()
backend.

12 years agoFix various compiler warnings.
Guus Sliepen [Sat, 21 Jul 2012 11:53:22 +0000 (13:53 +0200)]
Fix various compiler warnings.