chiark / gitweb /
site: Read public peer keys from key file
authorIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 7 Dec 2019 18:21:11 +0000 (18:21 +0000)
committerIan Jackson <ijackson@chiark.greenend.org.uk>
Sat, 15 Feb 2020 21:56:50 +0000 (21:56 +0000)
commitdb10dcc854450232187cec829c60dac619344d50
tree374e7acd12d845b785deb27deaab384961a1aec5
parent2bd5686634133cda9a40c6050ac2174c11504f1e
site: Read public peer keys from key file

Instead of a sigpubkey_if, we maintain a peer_keyset for the peer.

We try to get this from the new "peer-keys" configuration key which
specifies a file (to be parsed with the parser pubkeys.fl.pl).
Failing that we fall back to the old "key" (for key id 0000000000).

We actually keep up to two peer_keysets, because we don't want the set
to change during the middle of a key exchange.  (In the future, peer
keysets might change during operation.)  We make a "copy" (actually a
reference) at the start of key exchange.

We advertise the keyids we will accept in our MSG2/MSG3.  We expect
the peer to state in their MSG3/MSG4 which key they have actually
signed the message with.

This commit has a bug: it never calls sethash.  Our only algorithm
right now is rsa1 and needs sethash.  So attempts to use this will
segfault.

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