Mark Wooding [Mon, 23 Sep 2019 10:10:25 +0000 (11:10 +0100)]
Release 1.5.3.
Mark Wooding [Mon, 23 Sep 2019 10:09:03 +0000 (11:09 +0100)]
peerdb/tripe-newpeers.in: Fix output crash when there are `user' records.
Oh, dear. This really hasn't been a good release.
Mark Wooding [Sun, 22 Sep 2019 15:22:48 +0000 (16:22 +0100)]
Release 1.5.2.
Fix bungled `tripe-wireshark' package.
Mark Wooding [Sun, 22 Sep 2019 13:53:29 +0000 (14:53 +0100)]
Release 1.5.1.
Mark Wooding [Sun, 22 Sep 2019 13:46:53 +0000 (14:46 +0100)]
server/tests.at: Add roundtrip test for the crypto transforms.
This should avoid future débâcles like the one we had this time.
Mark Wooding [Sun, 22 Sep 2019 13:46:37 +0000 (14:46 +0100)]
server/test.c: Trace the key-exchange and bulk crypto details.
Mark Wooding [Sun, 22 Sep 2019 13:46:20 +0000 (14:46 +0100)]
server/test.c: Don't try to trace if it's turned off.
Mark Wooding [Sun, 22 Sep 2019 13:45:41 +0000 (14:45 +0100)]
server/test.c: Don't segfault if the keyring is bogus.
Mark Wooding [Sun, 22 Sep 2019 13:44:13 +0000 (14:44 +0100)]
server/tripe-admin.5.in: Document the `unsuitable-aead-cipher' warnings.
This was missed out of the earlier AEAD work.
Mark Wooding [Sun, 22 Sep 2019 13:43:41 +0000 (14:43 +0100)]
server/tripe-admin.5.in: Reorder the `KEYMGMT' warnings.
Now they're alphabetical by complaint.
Mark Wooding [Sun, 22 Sep 2019 13:40:13 +0000 (14:40 +0100)]
server/bulkcrypto.c: Support smaller nonce spaces, down to 40 bits.
Pack the type into the available space, however small it is.
Mark Wooding [Sun, 22 Sep 2019 13:39:34 +0000 (14:39 +0100)]
server/bulkcrypto.c: Abstract out the AEAD nonce formatting.
No functional change at this time.
Mark Wooding [Sun, 22 Sep 2019 13:36:21 +0000 (14:36 +0100)]
server/bulkcrypto.c: Adjust the scale in the data-format diagrams.
Two spaces per byte seems to work well.
Mark Wooding [Sun, 22 Sep 2019 09:24:31 +0000 (10:24 +0100)]
server/bulkcrypto.c: Fix segfault in `aead' algorithm setup.
I think I must have completely failed to test this prior to release.
Brown paper bag time. Add a new keyring to test this sort-of properly.
Mark Wooding [Sun, 22 Sep 2019 00:49:14 +0000 (01:49 +0100)]
Release 1.5.0.
Mark Wooding [Sun, 22 Sep 2019 00:18:58 +0000 (01:18 +0100)]
configure.ac, debian/control: Set Catacomb version now that it's released.
Mark Wooding [Sun, 22 Sep 2019 00:18:20 +0000 (01:18 +0100)]
Merge remote-tracking branch 'origin/1.0.0pre19.x'
* origin/1.0.0pre19.x:
Release 1.0.0pre19.1.
debian/: Use `dh_python2' for packaging.
Mark Wooding [Sat, 21 Sep 2019 23:07:33 +0000 (00:07 +0100)]
debian/control: Move the Wireshark gubbins back to general `Build-Depends'.
The Wireshark plugin directory is architecture-specific, so, while the
Lua dissector is architecture-neutral, the install directory isn't and
we have to build a separate package for each architecture.
This is rather vexing.
Mark Wooding [Thu, 5 Sep 2019 12:06:10 +0000 (13:06 +0100)]
server/bulkcrypto.c: Implement a bulk transform based on AEAD schemes.
Reimplement `naclbox' mostly in terms of this. It doesn't quite fit,
because `naclbox' can't be used directly for challenges.
Mark Wooding [Thu, 5 Sep 2019 12:00:21 +0000 (13:00 +0100)]
server/tripe.8.in: Use Rogaway's spelling `blockcipher' consistently.
Mark Wooding [Thu, 5 Sep 2019 12:02:53 +0000 (13:02 +0100)]
server/keymgmt.c: Trace the bulk-transform name.
Most of the bulk-crypto trace is pretty good, but somehow I failed to do
this before.
Mark Wooding [Sun, 17 Jun 2018 18:00:22 +0000 (19:00 +0100)]
pathmtu/pathmtu.c: Disable `raw' strategy if we don't have getifaddrs(3).
This isn't available on Android earlier than N.
Mark Wooding [Sun, 17 Jun 2018 17:07:40 +0000 (18:07 +0100)]
pathmtu/pathmtu.c: Place `addreq' with the rest of the `raw' strategy.
It's not needed for the `linux' strategy.
Mark Wooding [Sun, 17 Jun 2018 17:06:57 +0000 (18:06 +0100)]
pathmtu/pathmtu.c: Indent conditional `#define' properly.
Mark Wooding [Mon, 11 Jun 2018 15:34:10 +0000 (16:34 +0100)]
server/Makefile.am: Build most of the server into a library.
As a bonus, we get to avoid having to mention most of the files twice to
build both the server proper and the test program.
Mark Wooding [Sat, 19 May 2018 21:03:28 +0000 (22:03 +0100)]
server/: Make initialization errors be non-fatal and restartable.
It should now be possible to trap any error during startup, change any
part of the configuration, shut down the affected components, and
restart everything again, without taking down the whole process.
Mostly, this involves replacing the existing calls to `exit' with
goto-cleanup and return codes. In some cases, the existing
functionality has been reordered to make cleanup easier. I didn't leave
this for a separate commit, because including those changes here makes
it clearer what they're for and should make it easier to check that
they're the right fixes.
The details are:
* admin.c (a_listen): Move resetting the `umask' to the end.
Specifically, after the last part of the function that can fail.
This avoids a double reset if the final part, the call to listen(2),
fails.
* admin.c (a_init): Move creation of the service table to the end.
This isn't (currently) a thing that can be cleaned up, so do it only
after the parts that can fail -- specifically, initializing ADNS.
* keymgmt.c (kh_init): Use `kh->kf' as a flag to prevent double init.
As mentioned earlier, this is cleared by the static initializer, so
we can safely assume that `kh->kf' is null if and only if the
keyhalf requires initialization.
Also, reorder slightly, to establish the cache hashtable only after
the keyring file has been read.
* keymgmt.c (km_init): Refresh before fetching the master key.
Suppose we fail to initialize because the master key is missing.
The right fix is to update the keyring file with the proper key, and
then retry. But at this point the private keyhalf has been
initialized; so we must force a refresh of the keyring data.
* keymgmt.c (km_init): Be idempotent regarding the master key.
If there's a master key cached, then don't clobber it if we can't
find it again. On the other hand, if we find a different one this
time then switch.
Mark Wooding [Sat, 19 May 2018 20:51:11 +0000 (21:51 +0100)]
server/tripe.c, server/standalone.c: Split `main' out into a seprate file.
We can also remove the temporary hacks from `test.c'.
Mark Wooding [Sat, 19 May 2018 20:39:53 +0000 (21:39 +0100)]
server/: Build a proper interface for handling tunnel classes.
* Introduce functions for enumerating the available tunnel types,
looking one up by name, and returning a default tunnel. This
eliminates the direct access previously used by the admin code.
* Introduce a registration interface. This isn't necessary for our
purposes, but, in case it's not been obvious enough, the recent
changes have been directed towards making the server code suitable
as a library, and a user of this library might well need a custom
tunnel class.
Mark Wooding [Sat, 16 Jun 2018 12:16:11 +0000 (13:16 +0100)]
server/keymgmt.c: Capture copies of the keyring and tag strings.
Slightly complicated because the private-key tag can legitimately be
null to indicate that the old-fashioned search by key-exchange group
thing should be done.
Mark Wooding [Sat, 19 May 2018 20:12:10 +0000 (21:12 +0100)]
server/keymgmt.c, server/tripe.c: Add `km_clear' to shut down keyrings.
A bit more fiddly than our previous efforts, but this completes the job
of unwinding all of the configurable components of the server. The main
thing that doesn't get reset is the set of extant admin connections, and
I intend to leave those running until we have no choice.
Mark Wooding [Sat, 19 May 2018 19:49:27 +0000 (20:49 +0100)]
server/peer.c, server/tripe.c: Add `p_unbind' to tear down the UDP sockets.
Mark Wooding [Sat, 19 May 2018 19:36:10 +0000 (20:36 +0100)]
server/keymgmt.c (kh_init): Remove pointless setting of `kh->kf'.
It's statically initialized to be null. The only reason it might not be
is because we already changed it. Hmm... that gives me an idea.
Mark Wooding [Sat, 19 May 2018 19:05:49 +0000 (20:05 +0100)]
server/tripe.c, server/admin.c: Add a way to end the main loop.
This replaces the rather abrupt `a_quit' function. Cleanup is handled
in `main', using the facilities added recently.
For now, there's a stub version of `lp_end' in `test.c', joining
`iv_...' from earlier.
Mark Wooding [Sat, 19 May 2018 19:15:58 +0000 (20:15 +0100)]
server/peer.c, server/admin.c: Introduce `p_destroyall'.
Rather than having the loop in `a_quit' directly.
Mark Wooding [Sat, 19 May 2018 19:13:11 +0000 (20:13 +0100)]
server/admin.c: Introduce `a_unlisten' to shut down the admin socket.
Mark Wooding [Sat, 19 May 2018 20:54:22 +0000 (21:54 +0100)]
server/peer.c: Engage the interval timer only while there are peers.
The reason we need the interval timer is (a) to top up the entropy pool,
and (b) to clean up old keysets. If there are no peers, we do no key
exchange, so we don't need any random bits, and there are no keysets to
clear away. So we can save wakeups in this case.
For now, there are stub versions of `iv_(add|rm)reason' in `test.c', but
these will vanish once we split `main' out into its own file. (Spoiler
alert!)
Mark Wooding [Sat, 19 May 2018 19:01:36 +0000 (20:01 +0100)]
server/tripe.c: Formalize the main loop machinery.
The new `lp_init' function has taken on a number of miscellaneous
initialization tasks. But nothing has really changed much.
Mark Wooding [Sat, 19 May 2018 17:28:15 +0000 (18:28 +0100)]
server/tripe.c: Formalize the interval-timer arrangements.
The hard stuff is now (mostly) detached from the main initialization
code. There's also some machinery, currently unused, for disabling the
interval timer while it's not doing any good, which might be useful in
energy-constrained devices.
Mark Wooding [Sat, 19 May 2018 17:13:46 +0000 (18:13 +0100)]
server/keymgmt.c: Replace ad-hoc `die' with an `ABORT'-level warning.
It's either this or an `assert', and for some reason I didn't do that
the first time.
Mark Wooding [Sun, 13 May 2018 16:21:04 +0000 (17:21 +0100)]
server/peer.c (p_bind): Add the selector after fetching the port number.
This will make more sense later.
Mark Wooding [Sun, 13 May 2018 14:26:59 +0000 (15:26 +0100)]
server/: Issue `WARN' messages for (most) initialization errors.
Now, most initialization problems which aren't to do with duff arguments
are diagnosed as `WARN' messages rather than human-readable messages on
stderr.
Document the new warnings.
Mark Wooding [Sun, 13 May 2018 14:31:15 +0000 (15:31 +0100)]
server/tripe.c: Establish the stdio admin client early.
This way, warnings from peer initialization, for example, are reported
to the stdio admin client rather than stderr.
Mark Wooding [Sun, 13 May 2018 11:30:06 +0000 (12:30 +0100)]
server/admin.c (a_format): Introduce `?ERR' for explicitly named errors.
Judging by the documentation, `?ERRNO' is supposed to take an `int'
argument and format the error it specifies; but it actually works by
examining `errno', and all the callers know this. Changing it now seems
pointless, but I do want to be able to report errors in cases where
`errno' is or might be stale, and stuffing an error code back into
`errno' just so that it can be reported seems rather ugly.
Instead, add `?ERR' which /does/ accept an `int' argument, and fix the
documentation so that it describes reality.
Mark Wooding [Sun, 13 May 2018 00:56:44 +0000 (01:56 +0100)]
server/admin.c (a_listen): If stat(2) says the socket has gone, then retry.
This saves us from making an embarrassing `stat failed because ENOENT'
report.
Mark Wooding [Sat, 12 May 2018 20:58:12 +0000 (21:58 +0100)]
server/keymgmt.c: Remove redundant error reports.
Any I/O errors encountered while reading the key file will have been
reported already. In the same terms.
Previously, the final `die' message wasn't actually redundant, because
the earlier warnings got swallowed if we were going to run as a daemon.
It's obviously wrong that this happened, and the underlying cause has
been fixed properly now, so this isn't a concern any more.
Mark Wooding [Sat, 12 May 2018 23:36:36 +0000 (00:36 +0100)]
server/tripe.c: Be more clever about when to switch error output.
If we're going to detach and be a daemon, then we don't adopt
stdin/stdout as an initial administration client -- because we're going
to close these streams and disassociate from the surrounding
environment. On the other hand, if we /are/ going to adopt
stdin/stdout, it makes sense to report errors to the client listening
there as soon as we can, so that they can keep informed of our
progress. So take advantage of the new flexibility afforded by the
`a_switcherr' function, and switch the error output early or late
depending on whether we're going to daemonize.
Mark Wooding [Sat, 12 May 2018 21:20:36 +0000 (22:20 +0100)]
server/keymgmt.c (kh_reopen): Promote the happy path.
Mark Wooding [Sat, 12 May 2018 19:12:22 +0000 (20:12 +0100)]
server/: Split peer and admin initialization into smaller pieces.
Split admin initialization into:
* setting up internal data structures, which is `a_init' as before;
* establishing the daemonic signal handlers, which is now `a_signals';
* creating the admin socket and listening for incoming connections,
which is now `a_listen'; and
* switching alert reporting over to admin clients rather than stderr,
which is now `a_switcherr'.
Given that `a_listen' now need not actually be called, only unlink the
socket object if we actually created it.
Split peer initialization into:
* setting up the data structures, which is `p_init' as before; and
* creating the UDP sockets for communicating with other peers, which
is now `p_bind'.
This will make sense in context.
squash! server/: Split peer and admin initialization into smaller pieces.
server/admin.c: Split out signal-handler establishment.
Mark Wooding [Sat, 12 May 2018 18:55:26 +0000 (19:55 +0100)]
server/admin.c: Note that it's safe to call `a_create' before `a_init'.
A good thing too, because we do exactly this.
Mark Wooding [Sat, 12 May 2018 09:58:53 +0000 (10:58 +0100)]
server/tripe.c: Don't start privsep helper unless some tunnel needs it.
It just saves having a useless process hanging off the side.
Mark Wooding [Sat, 12 May 2018 09:44:14 +0000 (10:44 +0100)]
server/: Record port number with UDP socket, rather than querying.
The old `p_port' function queried getsockname(2) at runtime, and bailed
in the (very unlikely) event that it failed. Avoid this situation by
recording the port number when the socket is set up and just using the
recorded value when it's needed.
This was the only remaining abnormal exit after the server has started.
Mark Wooding [Sat, 12 May 2018 09:36:27 +0000 (10:36 +0100)]
server/: Wrap `udpsock' selectors up in a custom structure.
Now we can easily add more per-socket information. No functional change
at this stage.
Mark Wooding [Sat, 16 Jun 2018 14:52:21 +0000 (15:52 +0100)]
Rename `common/libtripe.a' to `.../libcommon.a'.
The main server will be a library soon, and it deserves that name more.
Mark Wooding [Sat, 16 Jun 2018 14:51:40 +0000 (15:51 +0100)]
common/Makefile.am: Zap spurious trailing blank line.
Mark Wooding [Wed, 11 Oct 2017 01:02:39 +0000 (02:02 +0100)]
server/: Post-merge fixup.
There's a slightly nasty semantic conflict between the two branches:
mdw/knock introduces a new function which sends a packet to an address
which might not belong to a registered peer, and mdw/ipv6 means that
this now has to cope with multiple address families. The mess is
surprisingly limited, all things considered.
Mark Wooding [Fri, 25 Jan 2019 12:08:24 +0000 (12:08 +0000)]
Merge branches 'mdw/knock' and 'mdw/ipv6' into bleeding
* mdw/knock:
Add notion of `ephemeral' associations and a goodbye protocol.
Add new `knock' protocol.
server/{keyexch,peer}.c: Maybe key-exchange messages come out of the blue.
server/keyexch.c (kx_message): Squish vertically.
server/keyexch.c: Abstract out the common message-handling behaviour.
server/keymgmt.c: Track and find keys by their 32-bit IDs.
server/test.c: Add a program to assist unit tests.
server/servutil.c: Add utilities for plain asymmetric encryption.
server/servutil.c: Add utilities for simple leaky-bucket rate limiting.
server/keyexch.c: Rename kx_init => kx_setup.
server/: Augment challenges to allow a payload.
server/chal.c: Capture `master->algs.bulk' in a variable.
server/chal.c: Rename bulk => bchal.
server/: Expose and enhance the bulk-key-derivation protocol.
* mdw/ipv6: (64 commits)
contrib/greet.in: Accept IPv6 addresses.
contrib/tripe-ipif.in: Fixing for IPv6.
svc/conntrack.in: Add IPv6 support.
svc/conntrack.in: Split out a base class from `InetAddress'.
svc/conntrack.in: Contemplate multiple address families.
svc/conntrack.in: Allow multiple networks in a peer pattern.
svc/conntrack.in (kickpeers): Refactor and reformat the search loop.
svc/conntrack.in (kickpeers): Rename `map' variable.
svc/conntrack.in: Process peer patterns in order.
svc/conntrack.in: Maintain config groups in a dictionary.
svc/conntrack.in: Make an `InetAddress' class to do address wrangling.
svc/conntrack.in: Factor out network parsing.
svc/conntrack.in: Gather address hacking functions into a new section.
svc/conntrack.in: Introduce a function for parsing address strings.
svc/conntrack.in (strmask): Consistently return a string object.
svc/conntrack.in: Fix netmask parsing.
svc/conntrack.in: Leave time for network configuration to settle.
svc/conntrack.in: Hoist `netupdown' above `kickpeers'.
server/, mon/: Introduce transport of TrIPE over IPv6.
server/addrmap.c (hash): Visually tighten the arithmetic.
...
Mark Wooding [Tue, 5 Sep 2017 21:26:51 +0000 (22:26 +0100)]
Add notion of `ephemeral' associations and a goodbye protocol.
When TrIPE kills an ephemeral peer, it sends a `bye' message to the
peer. When TrIPE receives `bye' from an ephemeral peer, it kills the
peer (without sending `bye' back).
Augment the `connect' service to set appropriate flags when adding
peers, and the Wireshark dissector to understand the new message.
Mark Wooding [Mon, 24 Dec 2018 15:53:42 +0000 (15:53 +0000)]
Release 1.0.0pre19.1.
Mark Wooding [Wed, 16 Aug 2017 04:03:58 +0000 (05:03 +0100)]
debian/: Use `dh_python2' for packaging.
Mark Wooding [Thu, 12 Oct 2017 01:39:26 +0000 (02:39 +0100)]
contrib/greet.in: Accept IPv6 addresses.
Mark Wooding [Tue, 26 Sep 2017 10:15:06 +0000 (11:15 +0100)]
contrib/tripe-ipif.in: Fixing for IPv6.
Accept `INET6' addresses from the server; detect IPv6 literals from the
configuration file; and adjust the MTU accordingly to compensate for the
different IP header lengths.
Mark Wooding [Fri, 29 Sep 2017 08:25:48 +0000 (09:25 +0100)]
svc/conntrack.in: Add IPv6 support.
This is now a simple matter of implementing an `Inet6Address' class and
tweaking the `parse_address' function.
Mark Wooding [Fri, 29 Sep 2017 08:23:43 +0000 (09:23 +0100)]
svc/conntrack.in: Split out a base class from `InetAddress'.
Now adding more families should be pretty easy.
Mark Wooding [Fri, 29 Sep 2017 08:15:05 +0000 (09:15 +0100)]
svc/conntrack.in: Contemplate multiple address families.
A number of relatively simple changes, with no overall functional change
except for a few diagnostic messages.
* Attach the address-family code and a name string to the
`InetAddress' class. This will mean that we can add new address
families without breaking things.
* Make `testaddrs' (and related variables) be a dictionary, mapping
address families to addresses, rather than just a lone address.
* Ensure that the networks in a peer assignment belong to the same
family. They will do for now, because there's only one.
* Have `kickpeers' maintain a local IP address for each family, rather
than just a single one.
Mark Wooding [Fri, 29 Sep 2017 00:24:47 +0000 (01:24 +0100)]
svc/conntrack.in: Allow multiple networks in a peer pattern.
This is sensible now that we're not trying to compare them for
specificness.
Mark Wooding [Fri, 29 Sep 2017 00:18:25 +0000 (01:18 +0100)]
svc/conntrack.in (kickpeers): Refactor and reformat the search loop.
The `ip' variable wasn't doing anything except remembering whether we'd
found a match, so replace it with a flag. This frees up the `ip' name,
so give that to the bizarrely named `ipq' variable which holds the
discovered local address.
Mark Wooding [Fri, 29 Sep 2017 00:13:53 +0000 (01:13 +0100)]
svc/conntrack.in (kickpeers): Rename `map' variable.
We shall want to call the `map' function.
Mark Wooding [Fri, 29 Sep 2017 00:05:26 +0000 (01:05 +0100)]
svc/conntrack.in: Process peer patterns in order.
Rewrite the configuration file parser entirely so as to process the
patterns in order, rather than messing about with topological sorting.
This will let us introduce various improvements to patterns which don't
have a clear specificness ordering.
Mark Wooding [Thu, 28 Sep 2017 23:15:19 +0000 (00:15 +0100)]
svc/conntrack.in: Maintain config groups in a dictionary.
Nothing cares about the relative order of the groups, and the
`showgroup' command wants to be able to look one up by name. Really,
the question is why I didn't do it like this the first time.
Mark Wooding [Thu, 28 Sep 2017 18:54:32 +0000 (19:54 +0100)]
svc/conntrack.in: Make an `InetAddress' class to do address wrangling.
The name is a little misleading: it can also represent a network, but
separating the two turns out to be a little tedious, so I don't bother.
This means that the configuration now actually contains (PEER,
TEST-ADDRESS, LOCAL-NET) triples, rather than keeping the address and
mask portions of the LOCAL-NET separate.
This is rather an invasive change. Sorry.
Mark Wooding [Thu, 28 Sep 2017 18:26:51 +0000 (19:26 +0100)]
svc/conntrack.in: Factor out network parsing.
The new function is a little stricter than the old one. The address
given must actually be the base address of the network, rather than any
old address within it.
Mark Wooding [Thu, 28 Sep 2017 18:20:35 +0000 (19:20 +0100)]
svc/conntrack.in: Gather address hacking functions into a new section.
Mark Wooding [Thu, 28 Sep 2017 18:16:33 +0000 (19:16 +0100)]
svc/conntrack.in: Introduce a function for parsing address strings.
It still returns a raw integer -- for now. But it's a start.
Mark Wooding [Thu, 28 Sep 2017 18:12:54 +0000 (19:12 +0100)]
svc/conntrack.in (strmask): Consistently return a string object.
Inexplicably, this used to return an integer if the mask covered a
prefix. Fortunately, it was always invoked in order to produce a thing
which is printed via `%s', which stringifies anyway.
Mark Wooding [Thu, 28 Sep 2017 18:10:34 +0000 (19:10 +0100)]
svc/conntrack.in: Fix netmask parsing.
* Improve the checking for a prefix length: see if the thing is
entirely made of digits, rather than searching for a `.'.
* More importantly, if we have a general netmask, then parse the
correct part of the network spec as the mask.
Mark Wooding [Thu, 28 Sep 2017 18:01:11 +0000 (19:01 +0100)]
svc/conntrack.in: Leave time for network configuration to settle.
Introduce new machinery to delay `kicking' the peer configuration.
* Changes as a result of reports from NetworkManager and similar are
now delayed, currently by 2s. Further reports restart the delay, so
we update 2s after the last report in a sequence. This long delay
is unfortunate, but necessary according to my experiments.
* The 30s interval timer no longer does anything if a kick is
scheduled but delayed.
* Kicks resulting from initial state inspections aren't delayed;
neither are direct user requests via the `up' and `down' commands.
Mark Wooding [Thu, 28 Sep 2017 17:58:07 +0000 (18:58 +0100)]
svc/conntrack.in: Hoist `netupdown' above `kickpeers'.
This will be part of a collection of little functions, and some will
definitely want to be above `kickpeers'. It seems silly to separate
them with this monster function.
Mark Wooding [Fri, 29 Sep 2017 09:08:52 +0000 (10:08 +0100)]
server/, mon/: Introduce transport of TrIPE over IPv6.
This depends on ADNS for IPv6 name resolution.
Mark Wooding [Fri, 29 Sep 2017 09:06:13 +0000 (10:06 +0100)]
server/addrmap.c (hash): Visually tighten the arithmetic.
Mark Wooding [Fri, 29 Sep 2017 08:58:08 +0000 (09:58 +0100)]
server/: Eliminate the remaining address-family-specific knowledge.
Outside of a few functions in `addrmap.c' and `servutil.c'. Name
resolution now fails softly if it encounters an unexpected address
family (which can happen because of numeric conversion through
`getaddrinfo'), and the ADNS query flags are now set via the `aftab'.
Mark Wooding [Fri, 29 Sep 2017 08:51:58 +0000 (09:51 +0100)]
server/: Maybe use GNU ADNS rather than mLib's `bres' for name resolution.
This will let us do IPv6 resolution later. For now, very little looks
like it's changed.
Mark Wooding [Sat, 16 Sep 2017 18:21:28 +0000 (19:21 +0100)]
server/: Use modern functions for address/text conversions.
The tricky part is the change to the `p_init' function, which now takes
a list of `addrinfo' structures and goes through the motions of matching
the addresses up to `udpsock' slots, but actually everything is rigged
so that there's only the IPv4 entry.
Mark Wooding [Sat, 16 Sep 2017 18:09:40 +0000 (19:09 +0100)]
server/admin.c (a_resolve): Parse using the `aftab' table.
Also, introduce a new `ANY' pseudo-family which does the right thing
using the resolver.
Mark Wooding [Sat, 16 Sep 2017 16:38:32 +0000 (17:38 +0100)]
server/: Introduce accessor functions for reading and writing port numbers.
There are still some raw accesses to port numbers outside of address-
family switches, but these are all concerned with conversions between
address structures and strings, and this will be fixed in a later
change.
Mark Wooding [Sat, 16 Sep 2017 16:06:41 +0000 (17:06 +0100)]
server/admin.h: Consolidate address construction during resolution.
Previously, setting up the socket address was kind of scattered
throughout the resolver code: the address family was set up front; the
port number stashed a bit later; and then the address plugged in once
the resolution job finished.
Instead, keep the port number separate once we've worked out what it is,
and build the entire socket address in one go at each site (once in the
background-resolver callback, and once for parsing a numerical address).
Mark Wooding [Sat, 16 Sep 2017 15:44:40 +0000 (16:44 +0100)]
server/admin.c (acmd_addr): Don't assert about the address family.
The `?ADDR' formatting directive can look after itself.
Mark Wooding [Sat, 16 Sep 2017 15:42:49 +0000 (16:42 +0100)]
server/admin.c: Tweak tracing of background resolver jobs.
This will make more sense later.
Mark Wooding [Sat, 16 Sep 2017 14:30:42 +0000 (15:30 +0100)]
server/: Institute `address family table'; contemplate multiple sockets.
This is a slightly oddly-shaped change which lays important groundwork
for the future.
* Firstly, it creates a table of address families, currently not very
interestingly since there's only one, but this will be an essential
tool for adding IPv6 support later.
* Secondly, it turns the peer module's `sock' into a global vector
`udpsock' of UDP sockets, possibly one for each of the supported
address families. There's no real change here, because there's only
one address family known, but the `port' command has grown an
address-family argument in case they have different ports. To make
this work, each peer now keeps track of the index of the socket it
should use for transmitting messages.
Mark Wooding [Fri, 15 Sep 2017 00:52:47 +0000 (01:52 +0100)]
pathmtu/pathmtu.c: Support IPv6 in the `raw' probing strategy.
Add code for constructing and parsing IPv6 packets. This is rather
annoying and fiddly, in ways which are excitingly different from the
ways in which raw sockets are exciting and fiddly with IPv4.
Mark Wooding [Fri, 15 Sep 2017 00:51:07 +0000 (01:51 +0100)]
pathmtu/pathmtu.c (raw): Switchify the code.
This is mostly an exercise in re-indenting things. There's no
functional change; here, we just ease the transition to the next commit.
Mark Wooding [Fri, 15 Sep 2017 00:46:31 +0000 (01:46 +0100)]
pathmtu/pathmtu.c (raw): Maintain the port numbers separately.
The Linux raw-IPv6-sockets machinery doesn't like port numbers in socket
addresses, so keep track of the ports separately and clear out the port
numbers in the address structures.
Mark Wooding [Thu, 14 Sep 2017 12:25:12 +0000 (13:25 +0100)]
pathmtu/pathmtu.c: Check against UDP header length, not pointer size.
Mark Wooding [Thu, 14 Sep 2017 10:32:18 +0000 (11:32 +0100)]
pathmtu/pathmtu.c: Use newer-style type names in pseudoheader struct.
Mark Wooding [Thu, 14 Sep 2017 09:14:59 +0000 (10:14 +0100)]
pathmtu/pathmtu.c: Support IPv6 in Linux probing method.
Mark Wooding [Thu, 14 Sep 2017 08:57:32 +0000 (09:57 +0100)]
pathmtu/pathmtu.c: Support IPv6 addresses in the generic code.
They don't work in any of the low-level methods yet. That's going to
come later.
Mark Wooding [Thu, 14 Sep 2017 08:25:33 +0000 (09:25 +0100)]
pathmtu/pathmtu.c: Replace explicit `sockaddr_in' structures with union.
First steps towards IPv6 support. There's no functional change, just a
bunch of refactoring and some extra checking which isn't currently
exercised.
Mark Wooding [Tue, 19 Sep 2017 09:02:25 +0000 (10:02 +0100)]
pathmtu/pathmtu.c (raw): Check the UDP packet signature.
Mark Wooding [Thu, 14 Sep 2017 08:38:04 +0000 (09:38 +0100)]
pathmtu/pathmtu.c: Document the `--verbose' option.
It wasn't supposed to be a secret.
Mark Wooding [Thu, 14 Sep 2017 08:56:11 +0000 (09:56 +0100)]
pathmtu/pathmtu.c: Document the correct short option for `--version'.
Mark Wooding [Wed, 13 Sep 2017 10:11:01 +0000 (11:11 +0100)]
proxy/tripe-mitm.c: Support for IPv6.
Now we're using getaddrinfo(3), we can also allow service names for
ports, but this is rather incidental.