Assert that we never try to fakepoll on sock -1.
[tor.git] / doc / tor-spec.txt
blob5536ef000785020e4b0843966a91c32583ef512a
1 sw$Id$
3 Tor Spec
5 Note: This is an attempt to specify Tor as it exists as implemented in
6 early March, 2004.  It is not recommended that others implement this
7 design as it stands; future versions of Tor will implement improved
8 protocols.
10 This is not a design document; most design criteria are not examined.  For
11 more information on why Tor acts as it does, see tor-design.pdf.
13 TODO: (very soon)
14       - EXTEND cells should have hostnames or nicknames, so that OPs never
15         resolve OR hostnames.  Else DNS servers can give different answers to
16         different OPs, and compromise their anonymity.
17          - Alternatively, directories should include IPs.
18       - REASON_CONNECTFAILED should include an IP.
19       - Copy prose from tor-design to make everything more readable.
22 0. Notation:
24    PK -- a public key.
25    SK -- a private key
26    K  -- a key for a symmetric cypher
28    a|b -- concatenation of 'a' and 'b'.
30    [A0 B1 C2] -- a three-byte sequence, containing the bytes with
31    hexadecimal values A0, B1, and C2, in that order.
33    All numeric values are encoded in network (big-endian) order.
35    Unless otherwise specified, all symmetric ciphers are AES in counter
36    mode, with an IV of all 0 bytes.  Asymmetric ciphers are either RSA
37    with 1024-bit keys and exponents of 65537, or DH with the safe prime
38    from rfc2409, section 6.2, whose hex representation is:
40      "FFFFFFFFFFFFFFFFC90FDAA22168C234C4C6628B80DC1CD129024E08"
41      "8A67CC74020BBEA63B139B22514A08798E3404DDEF9519B3CD3A431B"
42      "302B0A6DF25F14374FE1356D6D51C245E485B576625E7EC6F44C42E9"
43      "A637ED6B0BFF5CB6F406B7EDEE386BFB5A899FA5AE9F24117C4B1FE6"
44      "49286651ECE65381FFFFFFFFFFFFFFFF"
46 1. System overview
48    Onion Routing is a distributed overlay network designed to anonymize
49    low-latency TCP-based applications such as web browsing, secure shell,
50    and instant messaging. Clients choose a path through the network and
51    build a ``circuit'', in which each node (or ``onion router'' or ``OR'')
52    in the path knows its predecessor and successor, but no other nodes in
53    the circuit.  Traffic flowing down the circuit is sent in fixed-size
54    ``cells'', which are unwrapped by a symmetric key at each node (like
55    the layers of an onion) and relayed downstream.
57 2. Connections
59    There are two ways to connect to an onion router (OR). The first is
60    as an onion proxy (OP), which allows the OP to authenticate the OR
61    without authenticating itself.  The second is as another OR, which
62    allows mutual authentication.
64    Tor uses TLS for link encryption.  All implementations MUST support
65    the TLS ciphersuite "TLS_EDH_RSA_WITH_DES_192_CBC3_SHA", and SHOULD
66    support "TLS_DHE_RSA_WITH_AES_128_CBC_SHA" if it is available.
67    Implementations MAY support other ciphersuites, but MUST NOT
68    support any suite without ephemeral keys, symmetric keys of at
69    least 128 bits, and digests of at least 160 bits.
71    An OR always sends a self-signed X.509 certificate whose commonName
72    is the server's nickname, and whose public key is in the server
73    directory.
75    All parties receiving certificates must confirm that the public
76    key is as it appears in the server directory, and close the
77    connection if it is not.
79    Once a TLS connection is established, the two sides send cells
80    (specified below) to one another.  Cells are sent serially.  All
81    cells are 512 bytes long.  Cells may be sent embedded in TLS
82    records of any size or divided across TLS records, but the framing
83    of TLS records MUST NOT leak information about the type or contents
84    of the cells.
86    OR-to-OR connections are never deliberately closed.  When an OR
87    starts or receives a new directory, it tries to open new
88    connections to any OR it is not already connected to.
90    OR-to-OP connections are not permanent. An OP should close a
91    connection to an OR if there are no circuits running over the
92    connection, and an amount of time (KeepalivePeriod, defaults to 5
93    minutes) has passed.
95 3. Cell Packet format
97    The basic unit of communication for onion routers and onion
98    proxies is a fixed-width "cell".  Each cell contains the following
99    fields:
101         CircID                                [2 bytes]
102         Command                               [1 byte]
103         Payload (padded with 0 bytes)         [509 bytes]
104                                          [Total size: 512 bytes]
106    The CircID field determines which circuit, if any, the cell is
107    associated with.
109    The 'Command' field holds one of the following values:
110          0 -- PADDING     (Padding)                 (See Sec 6.2)
111          1 -- CREATE      (Create a circuit)        (See Sec 4)
112          2 -- CREATED     (Acknowledge create)      (See Sec 4)
113          3 -- RELAY       (End-to-end data)         (See Sec 5)
114          4 -- DESTROY     (Stop using a circuit)    (See Sec 4)
116    The interpretation of 'Payload' depends on the type of the cell.
117       PADDING: Payload is unused.
118       CREATE:  Payload contains the handshake challenge.
119       CREATED: Payload contains the handshake response.
120       RELAY:   Payload contains the relay header and relay body.
121       DESTROY: Payload is unused.
122    Upon receiving any other value for the command field, an OR must
123    drop the cell.
125    The payload is padded with 0 bytes.
127    PADDING cells are currently used to implement connection keepalive.
128    ORs and OPs send one another a PADDING cell every few minutes.
130    CREATE, CREATED, and DESTROY cells are used to manage circuits;
131    see section 4 below.
133    RELAY cells are used to send commands and data along a circuit; see
134    section 5 below.
136 4. Circuit management
138 4.1. CREATE and CREATED cells
140    Users set up circuits incrementally, one hop at a time. To create a
141    new circuit, OPs send a CREATE cell to the first node, with the
142    first half of the DH handshake; that node responds with a CREATED
143    cell with the second half of the DH handshake plus the first 20 bytes
144    of derivative key data (see section 4.2). To extend a circuit past
145    the first hop, the OP sends an EXTEND relay cell (see section 5)
146    which instructs the last node in the circuit to send a CREATE cell
147    to extend the circuit.
149    The payload for a CREATE cell is an 'onion skin', which consists
150    of the first step of the DH handshake data (also known as g^x).
152    The data is encrypted to Bob's PK as follows: Suppose Bob's PK is
153    L octets long.  If the data to be encrypted is shorter than L-42,
154    then it is encrypted directly (with OAEP padding).  If the data is at
155    least as long as L-42, then a randomly generated 16-byte symmetric
156    key is prepended to the data, after which the first L-16-42 bytes
157    of the data are encrypted with Bob's PK; and the rest of the data is
158    encrypted with the symmetric key.
160    So in this case, the onion skin on the wire looks like:
161        RSA-encrypted:
162          OAEP padding                  [42 bytes]
163          Symmetric key                 [16 bytes]
164          First part of g^x             [70 bytes]
165        Symmetrically encrypted:
166          Second part of g^x            [58 bytes]
168    The relay payload for an EXTEND relay cell consists of:
169          Address                       [4 bytes]
170          Port                          [2 bytes]
171          Onion skin                    [186 bytes]
173    The port and address field denote the IPV4 address and port of the
174    next onion router in the circuit.
176    The payload for a CREATED cell, or the relay payload for an
177    EXTENDED cell, contains:
178          DH data (g^y)                 [128 bytes]
179          Derivative key data (KH)      [20 bytes]   <see 4.2 below>
181    The CircID for a CREATE cell is an arbitrarily chosen 2-byte
182    integer, selected by the node (OP or OR) that sends the CREATE
183    cell.  To prevent CircID collisions, when one OR sends a CREATE
184    cell to another, it chooses from only one half of the possible
185    values based on the ORs' nicknames: if the sending OR has a
186    lexicographically earlier nickname, it chooses a CircID with a high
187    bit of 0; otherwise, it chooses a CircID with a high bit of 1.
189 4.2. Setting circuit keys
191    Once the handshake between the OP and an OR is completed, both
192    servers can now calculate g^xy with ordinary DH.  From the base key
193    material g^xy, they compute derivative key material as follows.
194    First, the server represents g^xy as a big-endian unsigned integer.
195    Next, the server computes 60 bytes of key data as K = SHA1(g^xy |
196    [00]) | SHA1(g^xy | [01]) | SHA1(g^xy | [02]) where "00" is a single
197    octet whose value is zero, [01] is a single octet whose value is
198    one, etc.  The first 20 bytes of K form KH, the next 16 bytes of K
199    form Kf, and the next 16 bytes of K form Kb.
201    KH is used in the handshake response to demonstrate knowledge of the
202    computed shared key. Kf is used to encrypt the stream of data going
203    from the OP to the OR, and Kb is used to encrypt the stream of data
204    going from the OR to the OP.
206 4.3. Creating circuits
208    When creating a circuit through the network, the circuit creator
209    (OP) performs the following steps:
211       1. Choose an onion router as an exit node (R_N), such that the onion
212          router's exit policy does not exclude all pending streams
213          that need a circuit.
215       2. Choose a chain of (N-1) chain of N onion routers
216          (R_1...R_N-1) to constitute the path, such that no router
217          appears in the path twice.
219       3. If not already connected to the first router in the chain,
220          open a new connection to that router.
222       4. Choose a circID not already in use on the connection with the
223          first router in the chain; send a CREATE cell along the
224          connection, to be received by the first onion router.
226       5. Wait until a CREATED cell is received; finish the handshake
227          and extract the forward key Kf_1 and the backward key Kb_1.
229       6. For each subsequent onion router R (R_2 through R_N), extend
230          the circuit to R.
232    To extend the circuit by a single onion router R_M, the OP performs
233    these steps:
235       1. Create an onion skin, encrypting the RSA-encrypted part with
236          R's public key.
238       2. Encrypt and send the onion skin in a relay EXTEND cell along
239          the circuit (see section 5).
241       3. When a relay EXTENDED cell is received, verify KH, and
242          calculate the shared keys.  The circuit is now extended.
244    When an onion router receives an EXTEND relay cell, it sends a CREATE
245    cell to the next onion router, with the enclosed onion skin as its
246    payload.  The initiating onion router chooses some circID not yet
247    used on the connection between the two onion routers.  (But see
248    section 4.1. above, concerning choosing circIDs based on
249    lexicographic order of nicknames.)
251    As an extension (called router twins), if the desired next onion
252    router R in the circuit is down, and some other onion router R'
253    has the same public keys as R, then it's ok to extend to R' rather than R.
255    When an onion router receives a CREATE cell, if it already has a
256    circuit on the given connection with the given circID, it drops the
257    cell.  Otherwise, after receiving the CREATE cell, it completes the
258    DH handshake, and replies with a CREATED cell.  Upon receiving a
259    CREATED cell, an onion router packs it payload into an EXTENDED relay
260    cell (see section 5), and sends that cell up the circuit.  Upon
261    receiving the EXTENDED relay cell, the OP can retrieve g^y.
263    (As an optimization, OR implementations may delay processing onions
264    until a break in traffic allows time to do so without harming
265    network latency too greatly.)
267 4.4. Tearing down circuits
269    Circuits are torn down when an unrecoverable error occurs along
270    the circuit, or when all streams on a circuit are closed and the
271    circuit's intended lifetime is over.  Circuits may be torn down
272    either completely or hop-by-hop.
274    To tear down a circuit completely, an OR or OP sends a DESTROY
275    cell to the adjacent nodes on that circuit, using the appropriate
276    direction's circID.
278    Upon receiving an outgoing DESTROY cell, an OR frees resources
279    associated with the corresponding circuit. If it's not the end of
280    the circuit, it sends a DESTROY cell for that circuit to the next OR
281    in the circuit. If the node is the end of the circuit, then it tears
282    down any associated edge connections (see section 5.1).
284    After a DESTROY cell has been processed, an OR ignores all data or
285    destroy cells for the corresponding circuit.
287    (The rest of this section is not currently used; on errors, circuits
288    are destroyed, not truncated.)
290    To tear down part of a circuit, the OP may send a RELAY_TRUNCATE cell
291    signaling a given OR (Stream ID zero).  That OR sends a DESTROY
292    cell to the next node in the circuit, and replies to the OP with a
293    RELAY_TRUNCATED cell.
295    When an unrecoverable error occurs along one connection in a
296    circuit, the nodes on either side of the connection should, if they
297    are able, act as follows:  the node closer to the OP should send a
298    RELAY_TRUNCATED cell towards the OP; the node farther from the OP
299    should send a DESTROY cell down the circuit.
301 4.5. Routing relay cells
303    When an OR receives a RELAY cell, it checks the cell's circID and
304    determines whether it has a corresponding circuit along that
305    connection.  If not, the OR drops the RELAY cell.
307    Otherwise, if the OR is not at the OP edge of the circuit (that is,
308    either an 'exit node' or a non-edge node), it de/encrypts the payload
309    with AES/CTR, as follows:
310         'Forward' relay cell (same direction as CREATE):
311             Use Kf as key; encrypt.
312         'Back' relay cell (opposite direction from CREATE):
313             Use Kb as key; decrypt.
315    The OR then decides whether it recognizes the relay cell, by
316    inspecting the payload as described in section 5.1 below.  If the OR
317    recognizes the cell, it processes the contents of the relay cell.
318    Otherwise, it passes the decrypted relay cell along the circuit if
319    the circuit continues.  If the OR at the end of the circuit
320    encounters an unrecognized relay cell, an error has occurred: the OR
321    sends a DESTROY cell to tear down the circuit.
323    When a relay cell arrives at an OP, it the OP encrypts the length and
324    payload fields with AES/CTR as follows:
325          OP receives data cell:
326             For I=N...1,
327                 Encrypt with Kb_I.  If the payload is recognized (see
328                 section 5.1), then stop and process the payload.
330    For more information, see section 5 below.
332 5. Application connections and stream management
334 5.1. Relay cells
336    Within a circuit, the OP and the exit node use the contents of
337    RELAY packets to tunnel end-to-end commands and TCP connections
338    ("Streams") across circuits.  End-to-end commands can be initiated
339    by either edge; streams are initiated by the OP.
341    The payload of each unencrypted RELAY cell consists of:
342          Relay command           [1 byte]
343          'Recognized'            [2 bytes]
344          StreamID               [2 bytes]
345          Digest                  [4 bytes]
346          Length                  [2 bytes]
347          Data                    [498 bytes]
349    The relay commands are:
350          1 -- RELAY_BEGIN
351          2 -- RELAY_DATA
352          3 -- RELAY_END
353          4 -- RELAY_CONNECTED
354          5 -- RELAY_SENDME
355          6 -- RELAY_EXTEND
356          7 -- RELAY_EXTENDED
357          8 -- RELAY_TRUNCATE
358          9 -- RELAY_TRUNCATED
359         10 -- RELAY_DROP
361    The 'Recognized' field in any unencrypted relay payload is always set
362    to zero; the 'digest' field is computed as the first four bytes of a
363    SHA-1 digest of the rest of the RELAY cell's payload, taken with the
364    digest field set to zero.
366    When the 'recognized' field of a RELAY cell is zero, and the digest
367    is correct, the cell is considered "recognized" for the purposes of
368    decryption (see section 4.5 above).
370    All RELAY cells pertaining to the same tunneled stream have the
371    same stream ID.  StreamIDs are chosen randomly by the OP.  RELAY
372    cells that affect the entire circuit rather than a particular
373    stream use a StreamID of zero.
375    The 'Length' field of a relay cell contains the number of bytes in
376    the relay payload which contain real payload data.  The remainder of
377    the payload is padded with random bytes.
379 5.2. Opening streams and transferring data
381    To open a new anonymized TCP connection, the OP chooses an open
382    circuit to an exit that may be able to connect to the destination
383    address, selects an arbitrary StreamID not yet used on that circuit,
384    and constructs a RELAY_BEGIN cell with a payload encoding the address
385    and port of the destination host.  The payload format is:
387          ADDRESS | ':' | PORT | [00]
389    where  ADDRESS is be a DNS hostname, or an IPv4 address in
390    dotted-quad format; and where PORT is encoded in decimal.
392    [What is the [00] for? -NM]
394    Upon receiving this cell, the exit node resolves the address as
395    necessary, and opens a new TCP connection to the target port.  If the
396    address cannot be resolved, or a connection can't be established, the
397    exit node replies with a RELAY_END cell.  (See 5.4 below.)
398    Otherwise, the exit node replies with a RELAY_CONNECTED cell, whose
399    payload is the 4-byte IP address to which the connection was made.
401    The OP waits for a RELAY_CONNECTED cell before sending any data.
402    Once a connection has been established, the OP and exit node
403    package stream data in RELAY_DATA cells, and upon receiving such
404    cells, echo their contents to the corresponding TCP stream.
405    RELAY_DATA cells sent to unrecognized streams are dropped.
407    Relay RELAY_DROP cells are long-range dummies; upon receiving such
408    a cell, the OR or OP must drop it.
410 5.3. Closing streams
412    When an anonymized TCP connection is closed, or an edge node
413    encounters error on any stream, it sends a 'RELAY_END' cell along the
414    circuit (if possible) and closes the TCP connection immediately.  If
415    an edge node receives a 'RELAY_END' cell for any stream, it closes
416    the TCP connection completely, and sends nothing more along the
417    circuit for that stream.
419    The payload of a RELAY_END cell begins with a single 'reason' byte to
420    describe why the stream is closing, plus optional data (depending on
421    the reason.)  The values are:
423        1 -- REASON_MISC           (catch-all for unlisted reasons)
424        2 -- REASON_RESOLVEFAILED  (couldn't look up hostname)
425        3 -- REASON_CONNECTFAILED  (couldn't connect to host/port)
426        4 -- REASON_EXITPOLICY     (OR refuses to connect to host or port)
427        5 -- REASON_DESTROY        (circuit is being destroyed [???-NM])
428        6 -- REASON_DONE           (anonymized TCP connection was closed)
429        7 -- REASON_TIMEOUT        (OR timed out while connecting [???-NM])
431    (With REASON_EXITPOLICY, the 4-byte IP address forms the optional
432    data; no other reason currently has extra data.)
435    *** [The rest of this section describes unimplemented functionality.]
437    Because TCP connections can be half-open, we follow an equivalent
438    to TCP's FIN/FIN-ACK/ACK protocol to close streams.
440    An exit connection can have a TCP stream in one of three states:
441    'OPEN', 'DONE_PACKAGING', and 'DONE_DELIVERING'.  For the purposes
442    of modeling transitions, we treat 'CLOSED' as a fourth state,
443    although connections in this state are not, in fact, tracked by the
444    onion router.
446    A stream begins in the 'OPEN' state.  Upon receiving a 'FIN' from
447    the corresponding TCP connection, the edge node sends a 'RELAY_FIN'
448    cell along the circuit and changes its state to 'DONE_PACKAGING'.
449    Upon receiving a 'RELAY_FIN' cell, an edge node sends a 'FIN' to
450    the corresponding TCP connection (e.g., by calling
451    shutdown(SHUT_WR)) and changing its state to 'DONE_DELIVERING'.
453    When a stream in already in 'DONE_DELIVERING' receives a 'FIN', it
454    also sends a 'RELAY_FIN' along the circuit, and changes its state
455    to 'CLOSED'.  When a stream already in 'DONE_PACKAGING' receives a
456    'RELAY_FIN' cell, it sends a 'FIN' and changes its state to
457    'CLOSED'.
459    If an edge node encounters an error on any stream, it sends a
460    'RELAY_END' cell (if possible) and closes the stream immediately.
463 6. Flow control
465 6.1. Link throttling
467    Each node should do appropriate bandwidth throttling to keep its
468    user happy.
470    Communicants rely on TCP's default flow control to push back when they
471    stop reading.
473 6.2. Link padding
475    Currently nodes are not required to do any sort of link padding or
476    dummy traffic. Because strong attacks exist even with link padding,
477    and because link padding greatly increases the bandwidth requirements
478    for running a node, we plan to leave out link padding until this
479    tradeoff is better understood.
481 6.3. Circuit-level flow control
483    To control a circuit's bandwidth usage, each OR keeps track of
484    two 'windows', consisting of how many RELAY_DATA cells it is
485    allowed to package for transmission, and how many RELAY_DATA cells
486    it is willing to deliver to streams outside the network.
487    Each 'window' value is initially set to 1000 data cells
488    in each direction (cells that are not data cells do not affect
489    the window).  When an OR is willing to deliver more cells, it sends a
490    RELAY_SENDME cell towards the OP, with Stream ID zero.  When an OR
491    receives a RELAY_SENDME cell with stream ID zero, it increments its
492    packaging window.
494    Each of these cells increments the corresponding window by 100.
496    The OP behaves identically, except that it must track a packaging
497    window and a delivery window for every OR in the circuit.
499    An OR or OP sends cells to increment its delivery window when the
500    corresponding window value falls under some threshold (900).
502    If a packaging window reaches 0, the OR or OP stops reading from
503    TCP connections for all streams on the corresponding circuit, and
504    sends no more RELAY_DATA cells until receiving a RELAY_SENDME cell.
505 [this stuff is badly worded; copy in the tor-design section -RD]
507 6.4. Stream-level flow control
509    Edge nodes use RELAY_SENDME cells to implement end-to-end flow
510    control for individual connections across circuits. Similarly to
511    circuit-level flow control, edge nodes begin with a window of cells
512    (500) per stream, and increment the window by a fixed value (50)
513    upon receiving a RELAY_SENDME cell. Edge nodes initiate RELAY_SENDME
514    cells when both a) the window is <= 450, and b) there are less than
515    ten cell payloads remaining to be flushed at that edge.
518 7. Directories and routers
520 7.1. Extensible information format
522 Router descriptors and directories both obey the following lightweight
523 extensible information format.
525 The highest level object is a Document, which consists of one or more Items.
526 Every Item begins with a KeywordLine, followed by one or more Objects. A
527 KeywordLine begins with a Keyword, optionally followed by a space and more
528 non-newline characters, and ends with a newline.  A Keyword is a sequence of
529 one or more characters in the set [A-Za-z0-9-].  An Object is a block of
530 encoded data in pseudo-Open-PGP-style armor. (cf. RFC 2440)
532 More formally:
534     Document ::= (Item | NL)+
535     Item ::= KeywordLine Object*
536     KeywordLine ::= Keyword NL | Keyword SP ArgumentsChar+ NL
537     Keyword = KeywordChar+
538     KeywordChar ::= 'A' ... 'Z' | 'a' ... 'z' | '0' ... '9' | '-'
539     ArgumentChar ::= any printing ASCII character except NL.
540     Object ::= BeginLine Base-64-encoded-data EndLine
541     BeginLine ::= "-----BEGIN " Keyword "-----" NL
542     EndLine ::= "-----END " Keyword "-----" NL
544     The BeginLine and EndLine of an Object must use the same keyword.
546 When interpreting a Document, software MUST reject any document containing a
547 KeywordLine that starts with a keyword it doesn't recognize.
549 7.1. Router descriptor format.
551 Every router descriptor MUST start with a "router" Item; MUST end with a
552 "router-signature" Item and an extra NL; and MUST contain exactly one
553 instance of each of the following Items: "published" "onion-key" "link-key"
554 "signing-key".  Additionally, a router descriptor MAY contain any number of
555 "accept", "reject", and "opt" Items.
557 The items' formats are as follows:
558    "router" nickname address (ORPort SocksPort DirPort bandwidth)?
559    "ports" ORPort SocksPort DirPort
560    "bandwidth" bandwidth
561    "platform" string
562    "published" YYYY-MM-DD HH:MM:SS
563    "onion-key" NL a public key in PEM format
564    "link-key" NL a public key in PEM format
565    "signing-key" NL a public key in PEM format
566    "accept" string
567    "reject" string
568    "router-signature" NL "-----BEGIN SIGNATURE-----" NL Signature NL
569                       "-----END SIGNATURE-----"
570    "opt" SP keyword string? NL,Object?
572 ORport ::= port where the router listens for routers/proxies (speaking cells)
573 SocksPort ::=  where the router listens for applications (speaking socks)
574 DirPort ::= where the router listens for directory download requests
575 bandwidth ::= maximum bandwidth, in bytes/s
576 nickname ::= between 1 and 19 alphanumeric characters, case-insensitive.
578 Bandwidth and ports are required; if they are not included in the router
579 line, they must appear in "bandwidth" and "ports" lines.
581 "opt" is reserved for non-critical future extensions.
583 7.2. Directory format
585 A Directory begins with a "signed-directory" item, followed by one each of
586 the following, in any order: "recommended-software".  It may include any
587 number of "opt" items.  After these items, a directory includes any number
588 of router descriptors, and a singer "directory-signature" item.
590     "signed-directory"
591     "recommended-software"  comma-separated-version-list
592     "directory-signature" NL Signature
594 Note:  The router descriptor for the directory server must appear first.
595 The signature is computed by computing the SHA-1 hash of the
596 directory, from the characters "signed-directory", through the newline
597 after "directory-signature".  This digest is then padded with PKCS.1,
598 and signed with the directory server's signing key.
600 If software encounters an unrecognized keyword in a single router descriptor,
601 it should reject only that router descriptor, and continue using the
602 others.  If it encounters an unrecognized keyword in the directory header,
603 it should reject the entire directory.
605 7.3. Behavior of a directory server
607 lists nodes that are connected currently
608 speaks http on a socket, spits out directory on request
610 -----------
611 (for emacs)
612   Local Variables:
613   mode:text
614   indent-tabs-mode:nil
615   fill-column:77
616   End: