12 .TH tripe-admin 5 "18 February 2001" "Straylight/Edgeware" "TrIPE: Trivial IP Encryption"
14 tripe-admin \- administrator commands for TrIPE
16 This manual page describes the administration interface provided by the
22 program can be used either interactively or in scripts to communicate
23 with the server using this interface. Alternatively, simple custom
24 clients can be written in scripting languages such as Perl, Python or
25 Tcl, or more advanced clients such as GUI monitors can be written in C
26 with little difficulty.
28 By default, the server listens for admin connections on the Unix-domain
30 .BR /var/lib/tripe/tripesock .
31 Administration commands use a textual protocol. Each client command or
32 server response consists of a line of ASCII text terminated by a single
33 linefeed character. No command may be longer than 255 characters.
34 .SS "General structure"
35 Each command or response line consists of a sequence of
36 whitespace-separated words. The number and nature of whitespace
37 characters separating two words in a client command is not significant;
38 the server always uses a single space character. The first word in a
41 identifying the type of command or response contained. Keywords in
42 client commands are not case-sensitive; the server always uses uppercase
45 For simple client command, the server responds with zero or more
47 lines, followed by either an
53 provides information requested in the command. An
55 response contains no further data. A
57 code is followed by a machine-readable explanation of why the command
60 Simple command processing is strictly synchronous: the server reads a
61 command, processes it, and responds, before reading the next command.
62 All commands can be run as simple commands. Long-running commands
67 block the client until they finish, but the rest of the server continues
69 .SS "Asynchronous messages"
70 There are three types of asynchronous messages which
71 aren't associated with any particular command.
75 message contains a machine-readable message warning of an error
76 encountered while processing a command, unexpected or unusual behaviour
77 by a peer, or a possible attack by an adversary. Under normal
78 conditions, the server shouldn't emit any warnings.
82 message contains a human-readable tracing message containing diagnostic
83 information. Trace messages are controlled using the
85 command-line option to the server, or the
87 administration command (see below). Support for tracing can be disabled
88 when the package is being configured, and may not be available in your
93 message is a machine-readable notification about some routine but
94 interesting event such as creation or destruction of peers.
96 The presence of asynchronous messages can be controlled using the
99 .SS "Background commands"
104 take a long time to complete. To prevent these long-running commands
105 from tying up a server connection, they can be run in the background.
106 Not all commands can be run like this: the ones that can provide a
108 option, which must be supplied with a
111 A command may fail before it starts running in the background. In this
112 case, the server emits a
114 response, as usual. To indicate that a command has started running in
115 the background, the server emits a response of the form
116 .BI "BGDETACH " tag \fR,
119 is the value passed to the
121 option. From this point on, the server is ready to process more
122 commands and reply to them.
124 Responses to background commands are indicated by a line beginning with
130 followed by the command tag. These correspond to the
135 responses for simple commands:
137 indicates information from a background command which has not completed
142 indicates that a background command succeeded or failed, respectively.
144 A background command will never issue an
148 response: it will always detach and then issue any
153 .SS "Network addresses"
154 A network address is a sequence of words. The first is a token
155 identifying the network address family. The length of an address and
156 the meanings of the subsequent words depend on the address family.
157 Address family tokens are not case-sensitive on input; on output, they
158 are always in upper-case.
160 At present, only one address family is understood.
162 .BI "INET " address " " port
163 An Internet socket, naming an IPv4 address and UDP port. On output, the
164 address is always in numeric dotted-quad form, and the port is given as
165 a plain number. On input, DNS hostnames and symbolic port names are
166 permitted. Name resolution does not block the main server, but will
167 block the requesting client, unless the command is run in the background.
169 If, on input, no recognised address family token is found, the following
170 words are assumed to represent an
172 address. Addresses output by the server always have an address family
174 .SS "Key-value output"
179 produce output in the form of
181 pairs, one per word. Neither the
187 Commands which enable or disable kinds of output (e.g.,
191 work in similar ways. They take a single optional argument, which
192 consists of a string of letters selecting message types, optionally
197 to disable, the subsequently listed types.
199 If the argument is omitted, the available message types are displayed,
202 line, in a fixed-column format. Column zero contains the key letter for
203 selecting that message type; column one contains either a space or a
205 sign, if the message type is disabled or enabled respectively; and a
206 textual description of the message type begins at column 3 and continues
207 to the end of the line.
209 Lowercase key letters control individual message types. Uppercase key
210 letters control collections of message types.
211 .SH "COMMAND REFERENCE"
213 The commands provided are:
215 .BI "ADD " peer " \fR[" options "\fR] " address "\fR..."
216 Adds a new peer. The peer is given the name
218 the peer's public key is assumed to be in the file
220 (or whatever alternative file was specified in the
222 option on the command line). The
224 is the network address (see above for the format) at which the peer can
225 be contacted. The following options are recognised.
229 .BI "\-background " tag
230 Run the command in the background, using the given
233 .BI "\-keepalive " time
234 Send a no-op packet if we've not sent a packet to the peer in the last
236 interval. This is useful for persuading port-translating firewalls to
237 believe that the `connection' is still active. The
239 is expressed as a nonnegative integer followed optionally by
245 for days, hours, minutes, or seconds respectively; if no suffix is
246 given, seconds are assumed.
248 .BI "\-tunnel " tunnel
249 Use the named tunnel driver, rather than the default.
256 line reporting the IP address and port number stored for
259 .BI "CHECKCHAL " challenge
260 Verifies a challenge as being one earlier issued by
262 and not previously either passed to
264 or in a greeting message.
267 Causes the server to disassociate itself from its terminal and become a
268 background task. This only works once. A warning is issued.
270 .BI "EPING \fR[" options "\fR] " peer
271 Sends an encrypted ping to the peer, and expects an encrypted response.
272 This checks that the peer is running (and not being impersonated), and
273 that it can encrypt and decrypt packets correctly. Options and
274 responses are the same as for the
279 Requests the server to begin a new key exchange with
284 Requests a challenge. The challenge is returned in an
286 line, as a base64-encoded string. See
289 .BI "GREET " peer " " challenge
290 Sends a greeting packet containing the
292 (base-64 encoded) to the named
294 The expectation is that this will cause the peer to recognize us and
295 begin a key-exchange.
298 Causes the server to emit an
300 line for each command it supports. Each line lists the command name,
301 followed by the names of the arguments. This may be helpful as a memory
302 aid for interactive use, or for program clients probing for features.
307 line containing the name of the network interface used to collect IP
308 packets which are to be encrypted and sent to
310 Used by configuration scripts so that they can set up routing tables
311 appropriately after adding new peers.
314 Causes the server to forget all about
316 All keys are destroyed, and no more packets are sent. No notification
317 is sent to the peer: if it's important that the peer be notified, you
318 must think of a way to do that yourself.
321 For each currently-known peer, an
323 line is written containing the peer's name, as given to
326 .BI "NOTIFY " tokens\fR...
329 notification to all interested administration clients.
332 Returns information about a peer, in key-value form. The following keys
337 The tunnel driver used for this peer.
340 The keepalive interval, in seconds, or zero if no keepalives are to be
344 .BI "PING \fR[" options "\fR] " peer
345 Send a transport-level ping to the peer. The ping and its response are
346 not encrypted or authenticated. This command, possibly in conjunction
347 with tracing, is useful for ensuring that UDP packets are actually
348 flowing in both directions. See also the
354 line is printed describing the outcome:
357 .BI "ping-ok " millis
358 A response was received
360 after the ping was sent.
363 No response was received within the time allowed.
366 The peer was killed (probably by another admin connection) before a
367 response was received.
370 Options recognized for this command are:
374 .BI "\-background " tag
375 Run the command in the background, using the given
378 .BI "\-timeout " time
381 seconds before giving up on a response. The default is 5 seconds. The
383 is expressed as a nonnegative integer followed optionally by
389 for days, hours, minutes, or seconds respectively; if no suffix is
390 given, seconds are assumed.
397 line containing just the number of the UDP port used by the
399 server. If you've allowed your server to allocate a port dynamically,
400 this is how to find out which one it chose.
403 Instructs the server to recheck its keyring files. The server checks
404 these periodically anyway but it may be necessary to force a recheck,
405 for example after adding a new peer key.
408 Instructs the server to exit immediately. A warning is sent.
411 Returns information about the server, in the form of key-value pairs.
412 The following keys are used.
416 A keyword naming the implementation of the
418 server. The current implementation is called
422 The server's version number, as reported by
430 if the server has or hasn't (respectively) become a daemon.
433 .BI "SETIFNAME " peer " " new-name
434 Informs the server that the
436 tunnel-interface name has been changed to
438 This is useful if firewalling decisions are made based on interface
439 names: a setup script for a particular peer can change the name, and
440 then update the server's records so that they're accurate.
445 lines, each containing one or more statistics in the form
446 .IB name = value \fR.
447 The statistics-gathering is experimental and subject to change.
449 .BR "TRACE " [\fIoptions\fP]
450 Selects trace outputs: see
452 above. Message types provided are:
455 Currently, the following tracing options are supported:
458 Tunnel events: reception of packets to be encrypted, and injection of
459 successfully-decrypted packets.
462 Peer management events: creation and destruction of peer attachments,
463 and arrival of messages.
466 Administration interface: acceptance of new connections, and handling of
467 the backgroud name-resolution required by the
472 Handling of symmetric keysets: creation and expiry of keysets, and
473 encryption and decryption of messages.
476 Key exchange: reception, parsing and emission of key exchange messages.
479 Key management: loading keys and checking for file modifications.
482 Display information about challenge issuing and verification.
485 Display contents of packets sent and received by the tunnel and/or peer
489 Display inputs, outputs and intermediate results of cryptographic
490 operations. This includes plaintext and key material. Use with
502 outputs provide extra detail for other outputs. Specifying
508 isn't useful; neither is specifying
519 For each available tunnel driver, an
521 line is printed giving its name.
524 Causes the server to emit an
526 line stating its software version, as two words: the server name, and
527 its version string. The server name
529 is reserved to the Straylight/Edgeware implementation.
531 .BR "WATCH " [\fIoptions\fP]
532 Enables or disables asynchronous messages
533 .IR "for the current connection only" .
536 above. The default watch state for the connection the server opens
537 automatically on stdin/stdout is to show warnings and trace messages;
538 other connections show no asynchronous messages. (This is done in order
539 to guarantee that a program reading the server's stdout does not miss
543 Message types provided are:
561 .BI "WARN " tokens\fR...
564 warning to all interested administration clients.
566 .\"* 20 Error messages (FAIL codes)
571 messages are sent to clients as a result of errors during command
579 server is already running as a daemon.
581 .BI "bad-addr-syntax " message
582 (For commands accepting socket addresses.) The address couldn't be
585 .BI "bad-syntax " cmd " " message
586 (For any command.) The command couldn't be understood: e.g., the number
587 of arguments was wrong.
589 .BI "bad-time-spec " word
592 is not a valid time interval specification. Acceptable time
593 specifications are nonnegative integers followed optionally by
599 for days, hours, minutes, or seconds, respectively.
601 .BI "bad-trace-option " char
604 An unknown trace option was requested.
606 .BI "bad-watch-option " char
609 An unknown watch option was requested.
611 .BI "daemon-error " ecode " " message
614 An error occurred during the attempt to become a daemon, as reported by
617 .BI "invalid-port " number
620 The given port number is out of range.
622 .BI "peer-create-fail " peer
627 failed for some reason. A warning should have been emitted explaining
630 .BI "peer-exists " peer
633 There is already a peer named
636 .B "ping-send-failed"
637 The attempt to send a ping packet failed, probably due to lack of
640 .BI "resolve-error " hostname
645 could not be resolved.
647 .BI "resolver-timeout " hostname
652 took too long to resolve.
654 .BI "unknown-command " token
659 .BI "unknown-peer " name
667 There is no peer called
670 .BI "unknown-service " service
678 .\"* 30 Notification broadcasts (NOTE codes)
679 The following notifications are sent to clients who request them.
681 .BI "ADD " peer " " ifname " " address \fR...
682 A new peer has been added. The peer's name is
684 its tunnel is network interface
686 and its network address is
690 The server has forked off into the sunset and become a daemon.
692 .BI "GREET " challenge " " address \fR...
693 A valid greeting was received, with the given challenge (exactly as it
706 finished successfully.
711 has begun or restarted. If key exchange keeps failing, this message
712 will be repeated periodically.
714 .BI "NEWIFNAME " peer " " old-name " " new-name
717 tunnel interface name has been changed from
725 .BI "USER " tokens\fR...
726 An administration client issued a notification using the
730 .\"* 40 Warning broadcasts (WARN codes)
732 There are many possible warnings. They are categorized according to
735 Many of these warnings report system errors. These are reported as a
736 pair of tokens, described below as
742 is a string of the form
746 value of the error; the
748 is the `human-readable' form of the message, as reported by
751 These all indicate that the
753 server has become unable to continue. If enabled, the server will dump
754 core in its configuration directory.
756 .BI "ABORT repeated-select-errors"
757 The main event loop is repeatedly failing. If the server doesn't quit,
758 it will probably waste all available CPU doing nothing.
760 These indicate a problem with the administration socket interface.
762 .BI "ADMIN accept-error " ecode " " message
763 There was an error while attempting to accept a connection from a new
766 .BI "ADMIN client-write-error " ecode " " message
767 There was an error sending data to a client. The connection to the
768 client has been closed.
770 These indicate errors in challenges, either in the
772 command or in greeting packets.
774 .B "CHAL impossible-challenge"
775 The server hasn't issued any challenges yet. Quite how anyone else
776 thought he could make one up is hard to imagine.
778 .B "CHAL incorrect-tag"
779 Challenge received contained the wrong authentication data. It might be
780 very stale, or a forgery.
782 .B "CHAL invalid-challenge"
783 Challenge received was the wrong length. We might have changed MAC
784 algorithms since the challenge was issued, or it might just be rubbish.
786 .B "CHAL replay duplicated-sequence"
787 Challenge received was a definite replay of an old challenge. Someone's
790 .B "CHAL replay old-sequence"
791 Challenge received was old, but maybe not actually a replay. Try again.
792 .SS "KEYMGMT warnings"
793 These indicate a problem with the keyring files, or the keys stored in
796 .BI "KEYMGMT bad-private-key " message
797 The private key could not be read, or failed a consistency check. If
798 there was a problem with the file, usually there will have been
800 warnings before this.
802 .BI "KEYMGMT bad-public-keyring " message
803 The public keyring couldn't be read. Usually, there will have been
805 warnings before this.
807 .BI "KEYMGMT key-file-error " file ":" line " " message
808 Reports a specific error with the named keyring file. This probably
812 .BI "KEYMGMT public-key " tag " " tokens\fR...
813 These messages all indicate a problem with the public key named
816 .BI "KEYMGMT public-key " tag " algorithm-mismatch"
817 The algorithms specified on the public key don't match the ones for our
818 private key. All the peers in a network have to use the same
821 .BI "KEYMGMT public-key " tag " bad " message
822 The public key couldn't be read, or is invalid.
824 .BI "KEYMGMT public-key " tag " bad-public-group-element"
825 The public key is invalid. This may indicate a malicious attempt to
826 introduce a bogus key.
828 .BI "KEYMGMT public-key " tag " bad-algorithm-selection"
829 The algorithms listed on the public key couldn't be understood. The
830 algorithm selection attributes are probably malformed and need fixing.
832 .BI "KEYMGMT public-key " tag " incorrect-group"
833 The public key doesn't use the same group as our private key. All the
834 peers in a network have to use the same group.
836 .BI "KEYMGMT public-key " tag " not-found"
837 The public key for peer
839 wasn't in the public keyring.
841 .BI "KEYMGMT public-key " tag " unknown-type"
842 The type of the public key isn't understood. Maybe you need to upgrade
845 (Even if you do, you'll have to regenerate your keys.)
847 These indicate problems during key-exchange. Many indicate either a bug
848 in the server (either yours or the remote one), or some kind of attack
849 in progress. All name a
851 as the second token: this is the peer the packet is apparently from,
852 though it may have been sent by an attacker instead.
854 In the descriptions below,
865 .BI "KX " peer " bad-expected-reply-log"
868 uses in its protocol contain a check value which proves that the
869 challenge is honest. This message indicates that the check value
870 supplied is wrong: someone is attempting to use bogus challenges to
873 server to leak private key information. No chance!
875 .BI "KX " peer " decrypt-failed reply\fR|\fBswitch-ok"
876 A symmetrically-encrypted portion of a key-exchange message failed to
879 .BI "KX " peer " invalid " msgtoken
880 A key-exchange message was malformed. This almost certainly indicates a
883 .BI "KX " peer " incorrect cookie\fR|\fBswitch-rq\fR|\fBswitch-ok"
884 A message didn't contain the right magic data. This may be a replay of
885 some old exchange, or random packets being sent in an attempt to waste
888 .BI "KX " peer " public-key-expired"
889 The peer's public key has expired. It's maintainer should have given
890 you a replacement before now.
892 .BI "KX " peer " sending-cookie"
893 We've received too many bogus pre-challenge messages. Someone is trying
894 to flood us with key-exchange messages and make us waste CPU on doing
895 hard asymmetric crypto sums.
897 .BI "KX " peer " unexpected " msgtoken
898 The message received wasn't appropriate for this stage of the key
899 exchange process. This may mean that one of our previous packets got
902 it may simply mean that the peer has recently restarted.
904 .BI "KX " peer " unknown-challenge"
905 The peer is asking for an answer to a challenge which we don't know
906 about. This may mean that we've been inundated with challenges from
907 some malicious source
908 .I who can read our messages
909 and discarded the valid one.
911 .BI "KX " peer " unknown-message 0x" nn
912 An unknown key-exchange message arrived.
914 These are largely concerned with management of peers and the low-level
915 details of the network protocol. The second word is usually the name of
920 .BI "PEER " peer " bad-packet no-type"
921 An empty packet arrived. This is very strange.
923 .BI "PEER " peer " bad-packet unknown-category 0x" nn
926 (in hex) isn't understood. Probably a strange random packet from
927 somewhere; could be an unlikely bug.
929 .BI "PEER " peer " bad-packet unknown-type 0x" nn
932 (in hex) isn't understood. Probably a strange random packet from
933 somewhere; could be an unlikely bug.
935 .BI "PEER " peer " corrupt-encrypted-ping"
936 The peer sent a ping response which matches an outstanding ping, but its
937 payload is wrong. There's definitely a bug somewhere.
939 .BI "PEER " peer " corrupt-transport-ping"
940 The peer (apparently) sent a ping response which matches an outstanding
941 ping, but its payload is wrong. Either there's a bug, or the bad guys
942 are playing tricks on you.
944 .BI "PEER " peer " decrypt-failed"
945 An encrypted IP packet failed to decrypt. It may have been mangled in
946 transit, or may be a very old packet from an expired previous session
947 key. There is usually a considerable overlap in the validity periods of
948 successive session keys, so this shouldn't occur unless the key exchange
951 .BI "PEER " peer " malformed-encrypted-ping"
952 The peer sent a ping response which is hopelessly invalid. There's
953 definitely a bug somewhere.
955 .BI "PEER " peer " malformed-transport-ping"
956 The peer (apparently) sent a ping response which is hopelessly invalid.
957 Either there's a bug, or the bad guys are playing tricks on you.
959 .BI "PEER " peer " packet-build-failed"
960 There wasn't enough space in our buffer to put the packet we wanted to
961 send. Shouldn't happen.
963 .BI "PEER \- socket-read-error " ecode " " message
964 An error occurred trying to read an incoming packet.
966 .BI "PEER " peer " socket-write-error " ecode " " message
967 An error occurred attempting to send a network packet. We lost that
970 .BI "PEER " peer " unexpected-encrypted-ping 0x" id
971 The peer sent an encrypted ping response whose id doesn't match any
972 outstanding ping. Maybe it was delayed for longer than the server was
973 willing to wait, or maybe the peer has gone mad.
975 .BI "PEER \- unexpected-source " address\fR...
976 A packet arrived from
978 (a network address \(en see above), but no peer is known at that
979 address. This may indicate a misconfiguration, or simply be a result of
980 one end of a connection being set up before the other.
982 .BI "PEER " peer " unexpected-transport-ping 0x" id
983 The peer (apparently) sent a transport ping response whose id doesn't
984 match any outstanding ping. Maybe it was delayed for longer than the
985 server was willing to wait, or maybe the peer has gone mad; or maybe
986 there are bad people trying to confuse you.
987 .SS "SERVER warnings"
988 These indicate problems concerning the server process as a whole.
990 .BI "SERVER ignore signal " name
991 A signal arrived, but the server ignored it. Currently this happens for
993 because that's a popular way of telling daemons to re-read their
994 configuration files. Since
996 re-reads its keyrings automatically and has no other configuration
997 files, it's not relevant, but it seemed better to ignore the signal than
1000 .BI "SERVER quit signal " \fR[\fInn\fR|\fIname\fR]
1001 A signal arrived and
1005 .BI "SERVER quit admin-request"
1006 A client of the administration interface issued a
1010 .BI "SERVER select-error " ecode " " message
1011 An error occurred in the server's main event loop. This is bad: if it
1012 happens too many times, the server will abort.
1014 These are concerned with the symmetric encryption and decryption
1017 .BI "SYMM replay old-sequence"
1018 A packet was received with an old sequence number. It may just have
1019 been delayed or duplicated, or it may have been an attempt at a replay
1022 .BI "SYMM replay duplicated-sequence"
1023 A packet was received with a sequence number we've definitely seen
1024 before. It may be an accidental duplication because the 'net is like
1025 that, or a deliberate attempt at a replay.
1027 These concern the workings of the system-specific tunnel driver. The
1028 second word is the name of the tunnel interface in question, or
1032 .BI "TUN \- bsd no-tunnel-devices"
1033 The driver couldn't find an available tunnel device. Maybe if you
1036 files, it will work.
1038 .BI "TUN - " tun-name " open-error " device " " ecode " " message
1039 An attempt to open the tunnel device file
1043 .BI "TUN \- linux config-error " ecode " " message
1044 Configuring the Linux TUN/TAP interface failed.
1046 .BI "TUN " ifname " " tun-name " read-error " ecode " " message
1047 Reading from the tunnel device failed.
1049 .BI "TUN " ifname " slip bad-escape"
1050 The SLIP driver encountered a escaped byte it wasn't expecting to see.
1051 The erroneous packet will be ignored.
1053 .BI "TUN " ifname " slip eof"
1054 The SLIP driver encountered end-of-file on its input descriptor.
1055 Pending data is discarded, and no attempt is made to read any more data
1056 from that interface ever.
1058 .BI "TUN " ifname " slip escape-end"
1059 The SLIP driver encountered an escaped `end' marker. This probably
1060 means that someone's been sending it junk. The erroneous packet is
1061 discarded, and we hope that we've rediscovered synchronization.
1063 .BI "TUN \- slip fork-error " ecode " " message
1064 The SLIP driver encountered an error forking a child process while
1065 allocating a new dynamic interface.
1067 .BI "TUN \- slip no-slip-interfaces"
1068 The driver ran out of static SLIP interfaces. Either preallocate more,
1069 or use dynamic SLIP interface allocation.
1071 .BI "TUN " ifname " slip overflow"
1072 The SLIP driver gave up reading a packet because it got too large.
1074 .BI "TUN \- slip pipe-error " ecode " " message
1075 The SLIP driver encountered an error creating pipes while allocating a
1076 new dynamic interface.
1078 .BI "TUN \- slip read-ifname-failed " ecode " " message
1079 The SLIP driver encountered an error reading the name of a dynamically
1080 allocated interface. Maybe the allocation script is broken.
1082 .BI "TUN \- unet config-error " ecode " " message
1083 Configuring the Linux Unet interface failed. Unet is obsolete and
1084 shouldn't be used any more.
1086 .BI "TUN \- unet getinfo-error " ecode " " message
1087 Reading information about the Unet interface failed. Unet is obsolete
1088 and shouldn't be used any more.
1090 .BI "TUN \- unet ifname-too-long"
1091 The Unet interface's name overflowed, so we couldn't read it properly.
1092 Unet is obsolete and shouldn't be used any more.
1094 These are issued by administration clients using the
1098 .BI "USER " tokens\fR...
1099 An administration client issued a warning.
1102 .SS "Command responses"
1105 .BI "BGFAIL " tag " " tokens \fR...
1106 .BI "BGINFO " tag " " tokens \fR...
1108 .BI "FAIL " tokens \fR...
1109 .BI "INFO " tokens \fR...
1117 .IR "The Trivial IP Encryption Protocol" .
1119 Mark Wooding, <mdw@distorted.org.uk>