Add an invitation protocol.

Using the tinc command, an administrator of an existing VPN can generate
invitations for new nodes. The invitation is a small URL that can easily
be copy&pasted into email or live chat. Another person can have tinc
automatically setup the necessary configuration files and exchange keys
with the server, by only using the invitation URL.

The invitation protocol uses temporary ECDSA keys. The invitation URL
consists of the hostname and port of the server, a hash of the server's
temporary ECDSA key and a cookie. When the client wants to accept an
invitation, it also creates a temporary ECDSA key, connects to the server
and says it wants to accept an invitation. Both sides exchange their
temporary keys. The client verifies that the server's key matches the hash
in the invitation URL. After setting up an SPTPS connection using the
temporary keys, the client gives the cookie to the server. If the cookie
is valid, the server sends the client an invitation file containing the
client's new name and a copy of the server's host config file. If everything
is ok, the client will generate a long-term ECDSA key and send it to the
server, which will add it to a new host config file for the client.

The invitation protocol currently allows multiple host config files to be
send from the server to the client. However, the client filters out
most configuration variables for its own host configuration file. In
particular, it only accepts Name, Mode, Broadcast, ConnectTo, Subnet and
AutoConnect. Also, at the moment no tinc-up script is generated.

When an invitation has succesfully been accepted, the client needs to start
the tinc daemon manually.
This commit is contained in:
Guus Sliepen 2013-05-29 18:31:10 +02:00
parent 12e68b95e6
commit ced4c1a327
13 changed files with 1297 additions and 54 deletions

View file

@ -90,6 +90,15 @@ is used.
The same as export followed by import.
.It exchange-all Op Fl -force
The same as export-all followed by import.
.It invite Ar name
Prepares an invitation for a new node with the given
.Ar name ,
and prints a short invitation URL that can be used with the join command.
.It join Op Ar URL
Join an existing VPN using an invitation URL created using the invite command.
If no
.Ar URL
is given, it will be read from standard input.
.It start Op tincd options
Start
.Xr tincd 8 ,

View file

@ -2214,6 +2214,14 @@ The same as export followed by import.
@item exchange-all [--force]
The same as export-all followed by import.
@item invite @var{name}
Prepares an invitation for a new node with the given @var{name},
and prints a short invitation URL that can be used with the join command.
@item join [@var{URL}]
Join an existing VPN using an invitation URL created using the invite command.
If no @var{URL} is given, it will be read from standard input.
@item start [tincd options]
Start @samp{tincd}, optionally with the given extra options.
@ -2232,10 +2240,17 @@ in @file{tinc.conf} will be made.
Shows the PID of the currently running @samp{tincd}.
@item generate-keys [@var{bits}]
Generate public/private keypair of @var{bits} length. If @var{bits} is not specified,
1024 is the default. tinc will ask where you want to store the files,
but will default to the configuration directory (you can use the -c or -n
option).
Generate both RSA and ECDSA keypairs (see below) and exit.
tinc will ask where you want to store the files, but will default to the
configuration directory (you can use the -c or -n option).
@item generate-ecdsa-keys
Generate public/private ECDSA keypair and exit.
@item generate-rsa-keys [@var{bits}]
Generate public/private RSA keypair and exit. If @var{bits} is omitted, the
default length will be 2048 bits. When saving keys to existing files, tinc
will not delete the old keys; you have to remove them manually.
@item dump [reachable] nodes
Dump a list of all known nodes in the VPN.