1NaCl(1) General Commands Manual NaCl(1)
2
3
4
6 CurveCP — Message-handling programs
7
9 curvecpclient [-q (optional)] [-Q (optional)] [-v (optional)] [-c
10 keydir(optional)] [sname] [pk] [ip] [port] [ext] [prog]
11
13 This manual page documents briefly the CurveCP commands.
14
15 A traditional UNIX-style server such as ftpd handles just one network
16 connection, reading input from stdin and writing output to stdout. A
17 "superserver" such as inetd or tcpserver listens for network connec‐
18 tions and starts a separate server process for each connection.
19
20 The CurveCP command-line tools have an extra level of modularity. The
21 curvecpserver superserver listens for network connections. For each
22 connection, curvecpserver starts the curvecpmessage message handler;
23 curvecpmessage then starts a server such as ftpd. Then ftpd sends a
24 stream of data to curvecpmessage, which in turn sends messages to
25 curvecpserver, which encrypts and authenticates the messages and sends
26 them inside network packets. At the same time curvecpclient receives
27 network packets, verifies and decrypts messages inside the packets, and
28 passes the messages to curvecpmessage; curvecpmessage sends a stream of
29 data to ftpd. The same curvecpmessage tool is also used by curvecp‐
30 client.
31
32 curvecpserver and curvecpclient can use programs other than curvecpmes‐
33 sage. Those programs can directly generate messages in the CurveCP mes‐
34 sage format without talking to separate tools such as ftpd; or they can
35 support a completely different protocol that reuses CurveCP's crypto‐
36 graphic layer but transmits different kinds of messages.
37
38 This page explains what programmers have to do to write curvecpmessage
39 replacements that talk to curvecpserver and curvecpclient.
40
42 File descriptor 8 is a pipe. Read from this pipe a length byte n,
43 between 1 and 68, and a 16*n-byte message. Repeat. The pipe is set to
44 non-blocking mode; be prepared for EAGAIN and EWOULDBLOCK, even in the
45 middle of a message.
46
47 This pipe reading must always be active. The curvecpclient and
48 curvecpserver programs assume that every message is read immediately.
49 If you can't handle a message immediately, read it and put it onto a
50 queue. If you don't have queue space, throw the message away; this
51 shouldn't cause trouble, since you have to be able to handle missing
52 messages in any case.
53
55 File descriptor 9 is a pipe. Write to this pipe a length byte n,
56 between 1 and 68, and a 16*n-byte message. Repeat. The pipe is set to
57 non-blocking mode; be prepared for EAGAIN and EWOULDBLOCK, even in the
58 middle of a message.
59
60 As a client, do not use length bytes above 40 until a message has
61 arrived from the server. (The messages inside CurveCP Initiate packets
62 are limited to 640 bytes.)
63
64 The CurveCP server does not start until it has received a message from
65 the client. Furthermore, the CurveCP server must receive this message
66 within 60 seconds of the client starting up. (The CurveCP Initiate
67 packet is valid for only 60 seconds after the corresponding CurveCP
68 Cookie packet.) This does not mean that the client must start sending
69 messages immediately, but it does mean that waiting for more than a
70 second to send a message is a bad idea.
71
73 How to use curvecpclient:
74
75 -q optional
76 no error messages
77
78 -Q optional
79 print error messages (default)
80
81 -v optional
82 print extra information
83
84 -c keydir optional
85 use this public-key directory
86
87 sname server's name
88
89 pk server's public key
90
91 ip server's IP address
92
93 port server's UDP port
94
95 ext server's extension
96
97 prog run this client
98
100 curvecpserver (1), curvecpmessage (1), inetd (8), tcpserver (1).
101
103 This manual page was written by Sergiusz Pawlowicz debian@pawlow‐
104 icz.name for the Debian system (and may be used by others). The source
105 of this page is a webpage http://curvecp.org/messageapi.html . Permis‐
106 sion is granted to copy, distribute and/or modify this document under
107 public domain.
108
109
110 This manual page was rewritten for the Debian distribution because the
111 original program does not have a manual page.
112
113
114
115 NaCl(1)