chiark / gitweb /
site: Keep old keys, and allow them to be used by peer
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 21 Jun 2012 01:16:12 +0000 (02:16 +0100)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Thu, 12 Jul 2012 19:02:22 +0000 (20:02 +0100)
commit02b0959b82910224e40025e06c01b59b65340c93
treefaddaed9d712fdf2529544043fd317b3db6b7d72
parent1d38856958136dc28a9d16f58a55f75867cdc57d
site: Keep old keys, and allow them to be used by peer

After we have switched to a new key, keep the old key around until we
see packets using the new key.

This is part of the fix to the "connectivity loss during final key
setup" bug.  Fixing this requires that both ends be willing to keep
both old and new data keys available until the peer has sent data with
the new key (which might never happen).

If there were also a key setup, the site would then need three keys:
the old data key, the current data key which the peer hasn't started
using yet, and the fresh key it is trying to negotiate.  So we have to
a third key, with its own lifetime expiry.

In the code we call the old key the "auxiliary" key because we're
going to use it for an additional fixup in the next patch.

Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
site.c