Merge commit 'origin/silc.1.1.branch'
[silc.git] / doc / draft-riikonen-silc-pp-09.nroff
1 .pl 10.0i
2 .po 0
3 .ll 7.2i
4 .lt 7.2i
5 .nr LL 7.2i
6 .nr LT 7.2i
7 .ds LF Riikonen
8 .ds RF FORMFEED[Page %]
9 .ds CF
10 .ds LH Internet Draft
11 .ds RH 15 January 2007
12 .ds CH
13 .na
14 .hy 0
15 .in 0
16 .nf
17 Network Working Group                                        P. Riikonen
18 Internet-Draft
19 draft-riikonen-silc-pp-09.txt                            15 January 2007
20 Expires: 15 July 2007
21
22 .in 3
23
24 .ce 2
25 SILC Packet Protocol
26 <draft-riikonen-silc-pp-09.txt>
27
28 .ti 0
29 Status of this Draft
30
31 By submitting this Internet-Draft, each author represents that any
32 applicable patent or other IPR claims of which he or she is aware
33 have been or will be disclosed, and any of which he or she becomes
34 aware will be disclosed, in accordance with Section 6 of BCP 79.
35
36 Internet-Drafts are working documents of the Internet Engineering
37 Task Force (IETF), its areas, and its working groups. Note that
38 other groups may also distribute working documents as Internet-
39 Drafts. Internet-Drafts are draft documents valid for a maximum of
40 six months and may be updated, replaced, or obsoleted by other
41 documents at any time. It is inappropriate to use Internet-Drafts as
42 reference material or to cite them other than as "work in progress".
43
44 The list of current Internet-Drafts can be accessed at
45 http://www.ietf.org/1id-abstracts.html
46 The list of Internet-Draft Shadow Directories can be accessed at
47 http://www.ietf.org/shadow.html.
48
49
50
51 .ti 0
52 Abstract
53
54 This memo describes a Packet Protocol used in the Secure Internet Live
55 Conferencing (SILC) protocol, specified in the Secure Internet Live
56 Conferencing, Protocol Specification [SILC1].  This protocol describes
57 the packet types and packet payloads which defines the contents of the
58 packets.  The protocol provides secure binary packet protocol that
59 assures that the contents of the packets are secured and authenticated.
60
61
62
63
64
65
66
67
68
69 .ti 0
70 Table of Contents
71
72 .nf
73 1 Introduction ..................................................  3
74   1.1 Requirements Terminology ..................................  4
75 2 SILC Packet Protocol ..........................................  4
76   2.1 SILC Packet ...............................................  4
77   2.2 SILC Packet Header ........................................  5
78   2.3 SILC Packet Types .........................................  8
79       2.3.1 SILC Packet Payloads ................................ 15
80       2.3.2 Generic payloads .................................... 16
81             2.3.2.1 ID Payload .................................. 16
82             2.3.2.2 Argument Payload ............................ 17
83             2.3.2.3 Argument List Payload ....................... 17
84             2.3.2.4 Channel Payload ............................. 18
85             2.3.2.5 Public Key Payload .......................... 19
86             2.3.2.6 Message Payload ............................. 20
87       2.3.3 Disconnect Payload .................................. 23
88       2.3.4 Success Payload ..................................... 24
89       2.3.5 Failure Payload ..................................... 25
90       2.3.6 Reject Payload ...................................... 25
91       2.3.7 Notify Payload ...................................... 26
92       2.3.8 Error Payload ....................................... 35
93       2.3.9 Channel Message Payload ............................. 35
94       2.3.10 Channel Key Payload ................................ 36
95       2.3.11 Private Message Payload ............................ 38
96       2.3.12 Private Message Key Payload ........................ 38
97       2.3.13 Command Payload .................................... 40
98       2.3.14 Command Reply Payload .............................. 41
99       2.3.15 Connection Auth Request Payload .................... 41
100       2.3.16 New ID Payload ..................................... 42
101       2.3.17 New Client Payload ................................. 43
102       2.3.18 New Server Payload ................................. 44
103       2.3.19 New Channel Payload ................................ 45
104       2.3.20 Key Agreement Payload .............................. 45
105       2.3.21 Resume Router Payload .............................. 47
106       2.3.22 File Transfer Payload .............................. 47
107       2.3.23 Resume Client Payload .............................. 48
108       2.3.24 Acknowledgement Payload ............................ 50
109   2.4 SILC ID Types ............................................. 50
110   2.5 Packet Encryption And Decryption .......................... 51
111       2.5.1 Normal Packet Encryption And Decryption ............. 51
112       2.5.2 Channel Message Encryption And Decryption ........... 52
113       2.5.3 Private Message Encryption And Decryption ........... 53
114   2.6 Packet MAC Generation ..................................... 53
115   2.7 Packet Padding Generation ................................. 54
116   2.8 Packet Compression ........................................ 54
117   2.9 Packet Sending ............................................ 55
118   2.10 Packet Reception ......................................... 55
119   2.11 Packet Routing ........................................... 55
120   2.12 Packet Broadcasting ...................................... 57
121 3 Security Considerations ....................................... 57
122 4 References .................................................... 57
123 5 Author's Address .............................................. 59
124 6 Full Copyright Statement ...................................... 59
125
126 .ti 0
127 List of Figures
128
129 .nf
130 Figure 1:   Typical SILC Packet
131 Figure 2:   SILC Packet Header
132 Figure 3:   ID Payload
133 Figure 4:   Argument Payload
134 Figure 5:   Argument List Payload
135 Figure 6:   Channel Payload
136 Figure 7:   Public Key Payload
137 Figure 8:   Message Payload
138 Figure 9:   Disconnect Payload
139 Figure 10:  Success Payload
140 Figure 11:  Failure Payload
141 Figure 12:  Reject Payload
142 Figure 13:  Notify Payload
143 Figure 14:  Error Payload
144 Figure 15:  Channel Key Payload
145 Figure 16:  Private Message Key Payload
146 Figure 17:  Command Payload
147 Figure 18:  Connection Auth Request Payload
148 Figure 19:  New Client Payload
149 Figure 20:  New Server Payload
150 Figure 21:  Key Agreement Payload
151 Figure 22:  Resume Router Payload
152 Figure 23:  File Transfer Payload
153 Figure 24:  Resume Client Payload
154
155
156 .ti 0
157 1. Introduction
158
159 This document describes a Packet Protocol used in the Secure Internet
160 Live Conferencing (SILC) protocol specified in the Secure Internet Live
161 Conferencing, Protocol Specification [SILC1].  This protocol describes
162 the packet types and packet payloads which defines the contents of the
163 packets.  The protocol provides secure binary packet protocol that
164 assures that the contents of the packets are secured and authenticated.
165 The packet protocol is designed to be compact to avoid unnecessary
166 overhead as much as possible.  This makes the SILC suitable also in
167 environment of low bandwidth requirements such as mobile networks.  All
168 packet payloads can also be compressed to further reduce the size of
169 the packets.
170
171 All packets in SILC network are always encrypted and their integrity
172 is assured by computed MACs.  The protocol defines several packet types
173 and packet payloads.  Each packet type usually has a specific packet
174 payload that actually defines the contents of the packet.  Each packet
175 also includes a default SILC Packet Header that provides sufficient
176 information about the origin and the destination of the packet.
177
178
179 .ti 0
180 1.1 Requirements Terminology
181
182 The keywords MUST, MUST NOT, REQUIRED, SHOULD, SHOULD NOT, RECOMMENDED,
183 MAY, and OPTIONAL, when they appear in this document, are to be
184 interpreted as described in [RFC2119].
185
186
187 .ti 0
188 2 SILC Packet Protocol
189
190 .ti 0
191 2.1 SILC Packet
192
193 SILC packets deliver messages from sender to receiver securely by
194 encrypting important fields of the packet.  The packet consists of
195 default SILC Packet Header, Padding, Packet Payload data, and, packet
196 MAC.
197
198 The following diagram illustrates typical SILC packet.
199
200 .in 5
201 .nf
202  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
203 |   n bytes   | 1 - n bytes |      n bytes       |  n bytes
204 | SILC Header |   Padding   |    Data Payload    |    MAC
205  - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
206 .in 3
207
208 .ce
209 Figure 1:  Typical SILC Packet
210
211
212 SILC Header is always the first part of the packet and its purpose
213 is to provide information about the packet.  It provides for example
214 the packet type, origin of the packet and the destination of the packet.
215 The header is variable in length.  See the following section for
216 description of SILC Packet header.  Packets without SILC header or
217 with malformed SILC header MUST be dropped.
218
219 Padding follows the packet header.  The purpose of the padding is to
220 make the packet multiple by eight (8) or by the block size of the
221 cipher used in the encryption, which ever is larger.  The maximum
222 length of padding is currently 128 bytes.  The padding is always
223 encrypted.  The padding is applied always, even if the packet is
224 not encrypted.  See the section 2.7 Padding Generation for more
225 detailed information.
226
227 Data payload area follows padding and it is the actual data of the
228 packet.  The packet data is the packet payloads defined in this
229 protocol.  The data payload area is always encrypted.
230
231 The last part of SILC packet is the packet MAC that assures the
232 integrity of the packet.  See the section 2.6 Packet MAC Generation
233 for more information.  If compression is used the compression is
234 always applied before encryption.
235
236 All fields in all packet payloads are always in MSB (most significant
237 byte first) order.
238
239
240 .ti 0
241 2.2 SILC Packet Header
242
243 The SILC packet header is applied to all SILC packets and it is
244 variable in length.  The purpose of SILC Packet header is to provide
245 detailed information about the packet.  The receiver of the packet
246 uses the packet header to parse the packet and gain other relevant
247 parameters of the packet.
248
249 The following diagram represents the SILC packet header.
250
251 .in 5
252 .nf
253                      1                   2                   3
254  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
256 |         Payload Length        |     Flags     |  Packet Type  |
257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
258 |   Pad Length  |    RESERVED   | Source ID Len |  Dest ID Len  |
259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
260 |  Src ID Type  |                                               |
261 +-+-+-+-+-+-+-+-+                                               +
262 |                                                               |
263 ~                           Source ID                           ~
264 |                                                               |
265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
266 |  Dst ID Type  |                                               |
267 +-+-+-+-+-+-+-+-+                                               +
268 |                                                               |
269 ~                         Destination ID                        ~
270 |                                                               |
271 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
272 .in 3
273
274 .ce
275 Figure 2:  SILC Packet Header
276
277 .in 6
278 o Payload Length (2 bytes) - Indicates the length of the
279   packet not including the padding of the packet.
280
281 o Flags (1 byte) - Indicates flags to be used in packet
282   processing.  Several flags may be set by ORing the flags
283   together.
284
285   The following flags are reserved for this field:
286
287
288      No flags                  0x00
289
290        In this case the field is ignored.
291
292
293      Private Message Key       0x01
294
295        Indicates that the packet data MUST include private
296        message that is encrypted using private key set by
297        client.  Servers does not know this key and cannot
298        decrypt the payload, but simply passes it along.  See
299        section 2.5.3 Private Message Encryption And Decryption
300        for more information.
301
302
303      List                      0x02
304
305        Indicates that the packet consists of list of
306        packet payloads indicated by the Packet Type field.
307        The payloads are added one after the other.  Note that
308        there are packet types that must not be used as
309        list.  Parsing of list packet is done by calculating
310        the length of each payload and parsing them one by
311        one.
312
313
314      Broadcast                 0x04
315
316        Marks the packet to be broadcasted.  Client and normal
317        server cannot send broadcast packets.  Only router server
318        may send broadcast packet.  The router receiving of packet
319        with this flag set MUST send (broadcast) the packet to
320        its primary route.  If router has several router connections
321        the packet may be sent only to the primary route.  See
322        section 2.12 Packet Broadcasting for description of
323        packet broadcasting.
324
325
326      Compressed                0x08
327
328        Marks that the payload of the packet is compressed.
329        The sender of the packet marks this flag when it
330        compresses the payload, and any server or router
331        en route to the recipient MUST NOT unset this flag.
332        See section 2.8 Packet Compression for description of
333        packet compressing.
334
335
336      Acknowledgement           0x10
337
338        Marks that the packet needs to be acknowledged by the
339        recipient.  The ACK packet MUST NOT have this flag set.
340        The acknowledgement packet is SILC_PACKET_ACK packet.
341        If the packet is not acknowledged the packet may be
342        retransmitted.  This flag is especially useful when
343        using UDP/IP and SHOULD NOT be used with TCP/IP.  The
344        flag MUST NOT be used with message packets.  The
345        SILC_MESSAGE_FLAG_ACK can be used instead.  Broadcast
346        packets MUST NOT set this flag.  Retransmission
347        may use for example exponential backoff algorithm.
348
349 .in 3
350
351 o Packet Type (1 byte) - Indicates the type of the packet.
352   Receiver uses this field to parse the packet.  See section
353   2.3 SILC Packets for list of defined packet types.
354
355 o Pad Length (1 byte) - Indicates the length of the padding
356   applied after the SILC Packet header.  Maximum length for
357   padding is 128 bytes.
358
359 o RESERVED (1 byte) - Reserved field and must include a
360   zero (0) value.
361
362 o Source ID Length (1 byte) - Indicates the length of the
363   Source ID field in the header, not including this or any
364   other fields.
365
366 o Destination ID Length (1 byte) - Indicates the length of the
367   Destination ID field in the header, not including this or
368   any other fields.
369
370 o Src ID Type (1 byte) - Indicates the type of ID in the
371   Source ID field.  See section 2.4 SILC ID Types for
372   defined ID types.
373
374 o Source ID (variable length) - The actual source ID that
375   indicates which is the original sender of the packet.
376
377 o Dst ID Type (1 byte) - Indicates the type of ID in the
378   Destination ID field.  See section 2.4 SILC ID Types for
379   defined ID types.
380
381 o Destination ID (variable length) - The actual destination
382   ID that indicates which is the end receiver of the packet.
383
384
385
386 .ti 0
387 2.3 SILC Packet Types
388
389 SILC packet types defines the contents of the packet and it is used by
390 the receiver to parse the packet.  The packet type is 8 bits in length.
391 The range for the packet types are from 0 - 255, where 0 is never sent and
392 255 is currently reserved for future extensions and MUST NOT be defined to
393 any other purpose.  Every SILC specification compliant implementation
394 SHOULD support all the following packet types.
395
396 The below list of the SILC Packet types includes reference to the packet
397 payload as well.  Packet payloads are the actual packet data area.  Each
398 packet type defines packet payload which usually may only be sent with
399 the specific packet type.
400
401 Most of the packets are packets that must be destined directly to entity
402 that is connected to the sender.  It is not allowed, for example, for a
403 router to send SILC_PACKET_DISCONNECT packet to client that is not
404 directly connected to the router.  However, there are some special packet
405 types that may be destined to some entity that the sender does not have
406 direct connection with.  These packets are for example private message
407 packets, channel message packets, command packets and some other packets
408 that may be broadcasted in the SILC network.  The following packet
409 desription list will define it separately if a packet is allowed to be
410 sent to indirectly connected entity.  Other packets MUST NOT be sent or
411 accepted, if sent, to indirectly connected entities.
412
413 Some packets MAY be sent as lists by adding the List flag to the Packet
414 Header and constructing multiple packet payloads one after the other.
415 When this is allowed it is separately defined in the following list.
416 Other packets MUST NOT be sent as list and the List flag MUST NOT be set.
417
418
419 List of SILC Packet types are defined as follows.
420
421 .in 1
422      0    SILC_PACKET_NONE
423
424           This type is reserved and it is never sent.
425
426
427      1    SILC_PACKET_DISCONNECT
428
429           This packet is sent to disconnect the remote end.  Reason of
430           the disconnection is sent inside the packet payload.
431
432           Payload of the packet:  See section 2.3.3 Disconnect Payload
433
434
435      2    SILC_PACKET_SUCCESS
436
437           This packet is sent upon successful execution of a protocol.
438           The status of the success is sent in the packet payload.
439
440           Payload of the packet:  See section 2.3.4 Success Payload
441
442
443      3    SILC_PACKET_FAILURE
444
445           This packet is sent upon failure of a protocol.  The status
446           of the failure is sent in the packet payload.
447
448           Payload of the packet:  See section 2.3.5 Failure Payload
449
450
451      4    SILC_PACKET_REJECT
452
453           This packet MAY be sent upon rejection of a protocol.  The
454           status of the rejection is sent in the packet payload.
455
456           Payload of the packet:  See section 2.3.6 Reject Payload
457
458
459      5    SILC_PACKET_NOTIFY
460
461           This packet is used to send notify message.  The packet is
462           usually sent between server and client, but also between
463           server and router.  Client MUST NOT send this packet.  Server
464           MAY destine this packet to channel as well when the packet is
465           distributed to all clients on the channel.  This packet MAY
466           be sent as list.
467
468           Payload of the packet:  See section 2.3.7 Notify Payload.
469
470
471      6    SILC_PACKET_ERROR
472
473           This packet is sent when an error occurs.  Server MAY
474           send this packet.  Client MUST NOT send this packet.  The
475           client MAY entirely ignore the packet, however, server is
476           most likely to take action anyway.  This packet MAY be sent
477           to entity that is indirectly connected to the sender.
478
479           Payload of the packet:  See section 2.3.8 Error Payload.
480
481
482      7    SILC_PACKET_CHANNEL_MESSAGE
483
484           This packet is used to send messages to channels.  The packet
485           includes Channel ID of the channel and the actual message to
486           the channel.  Messages sent to the channel are always protected
487           by channel specific keys.  This packet MAY be sent to entity
488           that is indirectly connected to the sender.
489
490           Payload of the packet:  See section 2.3.9 Channel Message
491                                   Payload
492
493
494      8    SILC_PACKET_CHANNEL_KEY
495
496           This packet is used to distribute new key for particular
497           channel when server generates it.  Each channel has their own
498           independent keys that is used to protect the traffic on the
499           channel.  It is also possible to use channel private keys that
500           are not server generated.  In this case this packet is not used.
501           Client MUST NOT send this packet.  This packet MAY be sent to
502           entity that is indirectly connected to the sender.
503
504           Payload of the packet:  See section 2.3.10 Channel Key Payload
505
506
507      9    SILC_PACKET_PRIVATE_MESSAGE
508
509           This packet is used to send private messages from client
510           to another client.  By default, private messages are protected
511           by session keys established by normal key exchange protocol.
512           However, it is possible to use specific key to protect private
513           messages.  See [SILC1] for private message key generation.
514           This packet MAY be sent to entity that is indirectly connected
515           to the sender.
516
517           Payload of the packet:  See section 2.3.11 Private Message
518                                   Payload
519
520
521      10   SILC_PACKET_PRIVATE_MESSAGE_KEY
522
523           This packet is OPTIONAL and sender of the packet can indicate
524           that a private message key should be used in private message
525           communication.  The actual key material is not sent in this
526           packet but must be either static or pre-shared key.  The
527           receiver of the packet is considered to be the responder
528           when processing the static or pre-shared key material as
529           defined in [SILC1] and [SILC3] for private message keys.
530           This packet MAY be sent to entity that is indirectly connected
531           to the sender.
532
533           Payload of the packet:  See section 2.3.12 Private Message
534                                   Key Payload
535
536
537      11   SILC_PACKET_COMMAND
538
539           This packet is used to send commands from client to server.
540           Server MAY send this packet to other servers as well.  All
541           commands are listed in their own section SILC Command Types
542           in [SILC4].  The contents of this packet is command specific.
543           This packet MAY be sent to entity that is indirectly connected
544           to the sender.
545
546           Payload of the packet:  See section 2.3.13 Command Payload
547
548
549      12   SILC_PACKET_COMMAND_REPLY
550
551           This packet is sent as reply to the SILC_PACKET_COMMAND packet.
552           The contents of this packet is command specific.  This packet
553           MAY be sent to entity that is indirectly connected to the
554           sender.  This packet MAY be sent as list.
555
556           Payload of the packet:  See section 2.3.14 Command Reply
557                                   Payload and section 2.3.13 Command
558                                   Payload
559
560
561      13   SILC_PACKET_KEY_EXCHANGE
562
563           This packet is used to start SILC Key Exchange Protocol,
564           described in detail in [SILC3].
565
566           Payload of the packet:  Payload of this packet is described
567                                   in the section SILC Key Exchange
568                                   Protocol and its sub sections in
569                                   [SILC3].
570
571
572      14   SILC_PACKET_KEY_EXCHANGE_1
573
574           This packet is used as part of the SILC Key Exchange Protocol.
575
576           Payload of the packet:  Payload of this packet is described
577                                   in the section SILC Key Exchange
578                                   Protocol and its sub sections in
579                                   [SILC3].
580
581
582      15   SILC_PACKET_KEY_EXCHANGE_2
583
584           This packet is used as part of the SILC Key Exchange Protocol.
585
586           Payload of the packet:  Payload of this packet is described
587                                   in the section SILC Key Exchange
588                                   Protocol and its sub sections in
589                                   [SILC3].
590
591
592      16   SILC_PACKET_CONNECTION_AUTH_REQUEST
593
594           This packet is used to request an authentication method to
595           be used in the SILC Connection Authentication Protocol.  If
596           initiator of the protocol does not know the mandatory
597           authentication method this packet MAY be used to determine it.
598           The party receiving this payload SHOULD respond with the same
599           packet including the mandatory authentication method.
600
601           Payload of the packet:  See section 2.3.15 Connection Auth
602                                   Request Payload
603
604
605      17   SILC_PACKET_CONNECTION_AUTH
606
607           This packet is used to start and perform the SILC Connection
608           Authentication Protocol.  This protocol is used to authenticate
609           the connecting party.  The protocol is described in detail in
610           [SILC3].
611
612           Payload of the packet:  Payload of this packet is described
613                                   in the section SILC Authentication
614                                   Protocol and it sub sections in [SILC].
615
616
617      18   SILC_PACKET_NEW_ID
618
619           This packet is used to distribute new IDs from server to
620           router and from router to all other routers in SILC network.
621           This is used when for example new client is registered to
622           SILC network.  The newly created IDs of these operations are
623           distributed by this packet.  Only server may send this packet,
624           however, client MUST be able to receive this packet.  This
625           packet MAY be sent to entity that is indirectly connected
626           to the sender.  This packet MAY be sent as list.
627
628           Payload of the packet:  See section 2.3.16 New ID Payload
629
630
631      19   SILC_PACKET_NEW_CLIENT
632
633           This packet is used by client to register itself to the
634           SILC network.  This is sent after key exchange and
635           authentication protocols has been completed.  Client sends
636           various information about itself in this packet to the server.
637
638           Payload of the packet:  See section 2.3.17 New Client Payload
639
640
641      20   SILC_PACKET_NEW_SERVER
642
643           This packet is used by server to register itself to the
644           SILC network.  This is sent after key exchange and
645           authentication protocols has been completed.  Server sends
646           this to the router it connected to, or, if router was
647           connecting, to the connected router.  Server sends its
648           Server ID and other information in this packet.  The client
649           MUST NOT send or receive this packet.
650
651           Payload of the packet:  See section 2.3.18 New Server Payload
652
653
654      21   SILC_PACKET_NEW_CHANNEL
655
656           This packet is used to notify routers about newly created
657           channel.  Channels are always created by the router and it MUST
658           notify other routers about the created channel.  Router sends
659           this packet to its primary route.  Client MUST NOT send this
660           packet.  This packet MAY be sent to entity that is indirectly
661           connected to the sender.  This packet MAY be sent as list.
662
663           Payload of the packet:  See section 2.3.19 New Channel Payload
664
665
666      22   SILC_PACKET_REKEY
667
668           This packet is used to indicate that re-key must be performed
669           for session keys.  See section Session Key Regeneration in
670           [SILC1] for more information.  This packet does not have
671           a payload.
672
673
674      23   SILC_PACKET_REKEY_DONE
675
676           This packet is used to indicate that re-key is performed and
677           new keys must be used hereafter.  This packet does not have a
678           payload.
679
680
681      24   SILC_PACKET_HEARTBEAT
682
683           This packet is used by clients, servers and routers to keep the
684           connection alive.  It is RECOMMENDED that all servers implement
685           keepalive actions and perform it to both direction in a link.
686           This packet does not have a payload.
687
688
689      25   SILC_PACKET_KEY_AGREEMENT
690
691           This packet is used by clients to request key negotiation
692           between another client in the SILC network.  If the negotiation
693           is started it is performed using the SKE protocol.  The result of
694           the negotiation, the secret key material, can be used for
695           example as private message key.  The server and router MUST NOT
696           send this packet.
697
698           Payload of the packet:  See section 2.3.20 Key Agreement Payload
699
700
701      26   SILC_PACKET_RESUME_ROUTER
702
703           This packet is used during backup router protocol when the
704           original primary router of the cell comes back online and wishes
705           to resume the position as being the primary router of the cell.
706
707           Payload of the packet:  See section 2.3.21 Resume Router Payload
708
709
710      27   SILC_PACKET_FTP
711
712           This packet is used to perform an file transfer protocol in the
713           SILC session with some entity in the network.  The packet is
714           multi purpose.  The packet is used to tell other entity in the
715           network that the sender wishes to perform an file transfer
716           protocol.  The packet is also used to actually tunnel the
717           file transfer protocol stream.  The file transfer protocol
718           stream is always protected with the SILC binary packet protocol.
719
720           Payload of the packet:  See section 2.3.22 File Transfer Payload
721
722
723      28   SILC_PACKET_RESUME_CLIENT
724
725           This packet is used to resume a client back to the network
726           after it has been detached.  A client is able to detach from
727           the network but the client is still valid client in the network.
728           The client may then later resume its session back by sending
729           this packet to a server.  Routers also use this packet to notify
730           other routers in the network that the detached client has resumed.
731
732           Payload of the packet:  See section 2.3.23 Resume Client Payload
733
734
735      29   SILC_PACKET_ACK
736
737           This packet is used to acknowledge a packet that had the
738           Acknowledgement packet flag set.
739
740           Payload of the packet:  See section 2.3.24 Acknowledgement
741           Payload
742
743
744      30 - 199
745
746           Currently undefined commands.
747
748
749      200 - 254
750
751           These packet types are reserved for private use and they will
752           not be defined by this document.
753
754
755      255  SILC_PACKET_MAX
756
757           This type is reserved for future extensions and currently it
758           MUST NOT be sent.
759 .in 3
760
761
762 .ti 0
763 2.3.1 SILC Packet Payloads
764
765 All payloads resides in the main data area of the SILC packet.  However
766 all payloads MUST be at the start of the data area after the SILC
767 packet header and padding.  All fields in the packet payload are always
768 encrypted, as they reside in the data area of the packet which is
769 always encrypted.  Most of the payloads may only be sent with specific
770 packet type which is defined in the description of the payload.
771
772 There are some other payloads in SILC as well.  However, they are not
773 common in the sense that they could be sent at any time.  These payloads
774 are not described in this section.  These are payloads such as SILC
775 Key Exchange payloads and so on.  These are described in [SILC1],
776 [SILC3] and [SILC4].
777
778
779 .ti 0
780 2.3.2 Generic payloads
781
782 This section describes generic payloads that are not associated to any
783 specific packet type.  They can be used for example inside some other
784 packet payload.
785
786
787 .ti 0
788 2.3.2.1 ID Payload
789
790 This payload can be used to send an ID.  ID's are variable in length
791 thus this payload provides a way to send variable length ID.
792
793 The following diagram represents the ID Payload.
794
795 .in 5
796 .nf
797                      1                   2                   3
798  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
799 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
800 |             ID Type           |           ID Length           |
801 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
802 |                                                               |
803 ~                           ID Data                             ~
804 |                                                               |
805 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
806 .in 3
807
808 .ce
809 Figure 3:  ID Payload
810
811
812 .in 6
813 o ID Type (2 bytes) - Indicates the type of the ID.  See
814   section 2.4 SILC ID Types for list of defined ID types.
815
816 o ID Length (2 bytes) - Length of the ID Data area not
817   including the length of any other fields in the payload.
818
819 o ID Data (variable length) - The actual ID data.  The encoding
820   of the ID data is defined in section 2.4 SILC ID Types.
821 .in 3
822
823
824 .ti 0
825 2.3.2.2 Argument Payload
826
827 Argument Payload is used to set arguments for any packet payload that
828 need and support arguments, such as commands.  Number of arguments
829 associated with a packet MUST be indicated by the packet payload which
830 need the arguments.  Argument Payloads MUST always reside right after
831 the packet payload needing the arguments.  Incorrect amount of argument
832 payloads MUST cause rejection of the packet.
833
834 The following diagram represents the Argument Payload.
835
836 .in 5
837 .nf
838                      1                   2                   3
839  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
841 |          Data Length          | Argument Type |               |
842 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+               +
843 |                                                               |
844 ~                        Argument Data                          ~
845 |                                                               |
846 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
847 .in 3
848
849 .ce
850 Figure 4:  Argument Payload
851
852
853 .in 6
854 o Data Length (2 bytes) - Length of the Argument Data field
855   not including the length of any other field in the payload.
856
857 o Argument Type (1 byte) - Indicates the type of the argument.
858   Every argument can have a specific type that are defined
859   by the packet payload needing the argument.  For example
860   every command specify a number for each argument that may be
861   associated with the command.  By using this number the receiver
862   of the packet knows what type of argument this is.  If there is
863   no specific argument type this field is set to zero (0) value.
864
865 o Argument Data (variable length) - Argument data.
866 .in 3
867
868
869 .ti 0
870 2.3.2.3 Argument List Payload
871
872 Argument List Payload is a list of Argument Payloads appended one
873 after the other.  The number of arguments is indicated in the
874 payload.
875
876 The following diagram represents the Argument List Payload.
877
878 .in 5
879 .nf
880                      1                   2                   3
881  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
882 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
883 |         Argument Nums         |                               |
884 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
885 |                                                               |
886 ~                        Argument Payloads                      ~
887 |                                                               |
888 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
889 .in 3
890
891 .ce
892 Figure 5:  Argument List Payload
893
894
895 .in 6
896 o Argument Nums (2 bytes) - Indicates the number of Argument
897   Payloads.  If zero (0) value is found in this field no
898   arguments are present.
899
900 o Argument Payloads (variable length) - The Argument Payloads
901   appended one after the other.  The payloads can be decoded
902   since the length of the payload is indicated in each of
903   the Argument Payload.
904 .in 3
905
906
907
908
909
910 .ti 0
911 2.3.2.4 Channel Payload
912
913 Generic Channel Payload may be used to send information about a channel,
914 its name, the Channel ID and a mode.
915
916 The following diagram represents the Channel Payload.
917
918
919 .in 5
920 .nf
921                      1                   2                   3
922  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
923 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
924 |      Channel Name Length      |                               |
925 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
926 |                                                               |
927 ~                         Channel Name                          ~
928 |                                                               |
929 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
930 |       Channel ID Length       |                               |
931 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
932 |                                                               |
933 ~                          Channel ID                           ~
934 |                                                               |
935 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
936 |                           Mode Mask                           |
937 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
938 .in 3
939
940 .ce
941 Figure 6:  New Channel Payload
942
943
944 .in 6
945 o Channel Name Length (2 bytes) - Length of the Channel Name
946   field.
947
948 o Channel Name (variable length) - The name of the channel.
949
950 o Channel ID Length (2 bytes) - Length of the Channel ID field.
951
952 o Channel ID (variable length) - The encoded Channel ID.
953
954 o Mode Mask (4 bytes) - A mode.  This can be the mode of the
955   channel but it can also be the mode of a client on the
956   channel.  The contents of this field is dependent of the
957   usage of this payload.  The usage is defined separately
958   when this payload is used.  This is a 32 bit MSB first value.
959 .in 3
960
961
962
963
964
965
966 .ti 0
967 2.3.2.5 Public Key Payload
968
969 Generic Public Key Payload may be used to send different type of
970 public keys and certificates.
971
972 The following diagram represents the Public Key Payload.
973
974 .in 5
975 .nf
976                      1                   2                   3
977  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
978 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
979 |       Public Key Length       |        Public Key Type        |
980 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
981 |                                                               |
982 ~                  Public Key (or certificate)                  ~
983 |                                                               |
984 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
985 .in 3
986
987 .ce
988 Figure 7:  Public Key Payload
989
990
991 .in 6
992 o Public Key Length (2 bytes) - The length of the Public Key
993   (or certificate) field, not including any other field.
994
995 o Public Key Type (2 bytes) - The public key (or certificate)
996   type.  This field indicates the type of the public key in
997   the packet.  See the [SILC3] for defined public key types.
998
999 o Public Key (or certificate) (variable length) - The
1000   encoded public key or certificate data.
1001 .in 3
1002
1003
1004 .ti 0
1005 2.3.2.6 Message Payload
1006
1007 Generic Message Payload can be used to send messages in SILC.  It
1008 is used to send channel messages and private messages.
1009
1010 The following diagram represents the Message Payload.
1011
1012 (*) indicates that the field is not encrypted.
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022 .in 5
1023 .nf
1024                      1                   2                   3
1025  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1026 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1027 |        Message  Flags         |         Message Length        |
1028 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1029 |                                                               |
1030 ~                         Message Data                          ~
1031 |                                                               |
1032 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1033 |        Padding Length         |                               |
1034 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1035 |                                                               |
1036 ~                            Padding                            ~
1037 |                                                               |
1038 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1039 |                                                               |
1040 ~                    Initialization Vector *                    ~
1041 |                                                               |
1042 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1043 |                                                               |
1044 ~                              MAC *                            ~
1045 |                                                               |
1046 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1047 .in 3
1048
1049 .ce
1050 Figure 8:  Message Payload
1051
1052
1053 .in 6
1054 o Message Flags (2 bytes) - Includes the Message Flags of the
1055   message.  The flags can indicate a reason or a purpose for
1056   the message.  The following Message Flags are defined:
1057
1058   0x0000  SILC_MESSAGE_FLAG_NONE
1059
1060           No specific flags set.
1061
1062   0x0001  SILC_MESSAGE_FLAG_AUTOREPLY
1063
1064           This message is an automatic reply to an earlier
1065           received message.
1066
1067   0x0002  SILC_MESSAGE_FLAG_NOREPLY
1068
1069           There should not be reply messages to this
1070           message.
1071
1072   0x0004  SILC_MESSAGE_FLAG_ACTION
1073
1074           The sender is performing an action and the message
1075           is the indication of the action.
1076
1077   0x0008  SILC_MESSAGE_FLAG_NOTICE
1078
1079           The message is for example an informational notice
1080           type message.
1081
1082   0x0010  SILC_MESSAGE_FLAG_REQUEST
1083
1084           This is a generic request flag to send request
1085           messages.  A separate document should define any
1086           payloads associated to this flag.
1087
1088   0x0020  SILC_MESSAGE_FLAG_SIGNED
1089
1090           This flag indicates that the message is signed
1091           with sender's private key and thus can be verified
1092           by the receiver using the sender's public key.  A
1093           separate document should define the detailed procedure
1094           of the signing process and any associated payloads
1095           for this flag.
1096
1097   0x0040  SILC_MESSAGE_FLAG_REPLY
1098
1099           This is a generic reply flag to send a reply to
1100           previously received request.  A separate document
1101           should define any payloads associated to this flag.
1102
1103   0x0080  SILC_MESSAGE_FLAG_DATA
1104
1105           This is a generic data flag, indicating that the
1106           message includes some data which can be interpreted
1107           in a specific way.  Using this flag any kind of data
1108           can be delivered inside message payload.  A separate
1109           document should define how this flag is interpreted
1110           and define any associated payloads.
1111
1112   0x0100  SILC_MESSAGE_FLAG_UTF8
1113
1114           This flag indicates that the message is UTF-8 encoded
1115           textual message.  When sending text messages in SILC
1116           this flag SHOULD be used.  When this flag is used the
1117           text sent as message MUST be UTF-8 encoded.
1118
1119   0x0200  SILC_MESSAGE_FLAG_ACK
1120
1121           This flag indicates the sender requires the recpipient
1122           to acknowledge the received message.  This same flag
1123           is used in the acknowledgement.  A separate document
1124           should define how the acknowledgement is performed.
1125
1126   0x0400 - 0x1000 RESERVED
1127
1128           Reserved for future flags.
1129
1130   0x2000 - 0x8000 PRIVATE RANGE
1131
1132           Private range for free use.
1133
1134 o Message Length (2 bytes) - Indicates the length of the
1135   Message Data field in the payload, not including any
1136   other field.
1137
1138 o Message Data (variable length) - The actual message data.
1139
1140 o Padding Length (2 bytes) - Indicates the length of the
1141   Padding field in the payload, not including any other
1142   field.
1143
1144 o Padding (variable length) - If this payload is used as
1145   channel messages, the padding MUST be applied because
1146   this payload is encrypted separately from other parts
1147   of the packet.  If this payload is used as private
1148   messages, the padding is present only when the payload
1149   is encrypted with private message key.  If encrypted
1150   with session keys this field MUST NOT be present and the
1151   Padding Length field includes a zero (0) value.  The
1152   padding SHOULD be random data.
1153
1154 o Initialization Vector (variable length) - This field MUST
1155   be present when this payload is used as channel messages.
1156   The IV SHOULD be random data for each channel message.
1157
1158   When encrypting private messages with session keys this
1159   field MUST NOT be present.  For private messages this field
1160   is present only when encrypting with a static private
1161   message key (pre-shared key).  If randomly generated key
1162   material is used this field MUST NOT be present.  Also,
1163   If Key Agreement (SKE) was used to negotiate fresh key
1164   material for private message key this field MUST NOT be
1165   present.  See the section 4.6 in [SILC1] for more
1166   information about IVs when encrypting private messages.
1167
1168   This field includes the initialization vector used in message
1169   encryption.  It need to be used in the packet decryption
1170   as well.  Contents of this field depends on the encryption
1171   algorithm and encryption mode.  This field is not encrypted,
1172   is not included in padding calculation and its length
1173   equals to cipher's block size.  This field is authenticated
1174   by the message MAC.
1175
1176 o MAC (variable length) - The MAC computed from the
1177   Message Flags, Message Length, Message Data, Padding Length,
1178   Padding and Initialization Vector fields in that order.
1179   The MAC is computed after the payload is encrypted.  This
1180   is so called Encrypt-Then-MAC order; first encrypt, then
1181   compute MAC from ciphertext.  The MAC protects the integrity
1182   of the Message Payload.  Also, when used as channel messages
1183   it is possible to have multiple private channel keys set,
1184   and receiver can use the MAC to verify which of the keys
1185   must be used in decryption.  This field is not present
1186   when encrypting private messages with session key.  This
1187   field is not encrypted.  This field is authenticated by
1188   the SILC packet MAC.
1189 .in 3
1190
1191
1192 .ti 0
1193 2.3.3 Disconnect Payload
1194
1195 Disconnect payload is sent upon disconnection.  Reason of the
1196 disconnection is sent to the disconnected party in the payload.
1197
1198 The payload may only be sent with SILC_PACKET_DISCONNECT packet.  It
1199 MUST NOT be sent in any other packet type.  The following diagram
1200 represents the Disconnect Payload.
1201
1202
1203 .in 5
1204 .nf
1205                      1                   2                   3
1206  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1207 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1208 |    Status     |                                               |
1209 +-+-+-+-+-+-+-+-+                                               +
1210 |                                                               |
1211 ~                      Disconnect Message                       ~
1212 |                                                               |
1213 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1214 .in 3
1215
1216 .ce
1217 Figure 9:  Disconnect Payload
1218
1219 .in 6
1220 o Status (1 byte) - Indicates the Status Type, defined in [SILC3]
1221   for the reason of disconnection.
1222
1223 o Disconnect Message (variable length) - Human readable UTF-8
1224   encoded string indicating reason of the disconnection.  This
1225   field MAY be omitted.
1226 .in 3
1227
1228
1229 .ti 0
1230 2.3.4 Success Payload
1231
1232 Success payload is sent when some protocol execution is successfully
1233 completed.  The payload is simple; indication of the success is sent.
1234 This may be any data, including binary or human readable data, and
1235 it is protocol dependent.
1236
1237 .in 5
1238 .nf
1239                      1                   2                   3
1240  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1241 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1242 |                                                               |
1243 ~                      Success Indication                       ~
1244 |                                                               |
1245 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1246 .in 3
1247
1248 .ce
1249 Figure 10:  Success Payload
1250
1251
1252 .in 6
1253 o Success Indication (variable length) - Indication of
1254   the success.  This may be for example some flag that
1255   indicates the protocol and the success status or human
1256   readable success message.  The true length of this
1257   payload is available by calculating it from the SILC
1258   Packet Header.
1259 .in 3
1260
1261
1262 .ti 0
1263 2.3.5 Failure Payload
1264
1265 This is opposite of Success Payload.  Indication of failure of
1266 some protocol is sent in the payload.
1267
1268 .in 5
1269 .nf
1270                      1                   2                   3
1271  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1273 |                                                               |
1274 ~                      Failure Indication                       ~
1275 |                                                               |
1276 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1277 .in 3
1278
1279 .ce
1280 Figure 11:  Failure Payload
1281
1282
1283 .in 6
1284 o Failure Indication (variable length) - Indication of
1285   the failure.  This may be for example some flag that
1286   indicates the protocol and the failure status or human
1287   readable failure message.  The true length of this
1288   payload is available by calculating it from the SILC
1289   Packet Header.
1290 .in 3
1291
1292
1293 .ti 0
1294 2.3.6 Reject Payload
1295
1296 This payload is sent when some protocol is rejected to be executed.
1297 Other operations MAY send this as well that was rejected.  The
1298 indication of the rejection is sent in the payload.  The indication
1299 may be binary or human readable data and is protocol dependent.
1300
1301
1302 .in 5
1303 .nf
1304                      1                   2                   3
1305  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1306 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1307 |                                                               |
1308 ~                       Reject Indication                       ~
1309 |                                                               |
1310 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1311 .in 3
1312
1313 .ce
1314 Figure 12:  Reject Payload
1315
1316
1317 .in 6
1318 o Reject Indication (variable length) - Indication of
1319   the rejection.  This maybe for example some flag that
1320   indicates the protocol and the rejection status or human
1321   readable rejection message.  The true length of this
1322   payload is available by calculating it from the SILC
1323   Packet Header.
1324 .in 3
1325
1326
1327
1328 .ti 0
1329 2.3.7 Notify Payload
1330
1331 Notify payload is used to send notify messages.  The payload is usually
1332 sent from server to client and from server to router.  It is also used
1333 by routers to notify other routers in the network.  This payload MAY also
1334 be sent to a channel.  Client MUST NOT send this payload.  When this
1335 packet is received by client it SHOULD process it.  Servers and routers
1336 MUST process notify packets.
1337
1338 The payload may only be sent with SILC_PACKET_NOTIFY packet.  It MUST
1339 NOT be sent in any other packet type.  The following diagram represents
1340 the Notify Payload.
1341
1342
1343
1344 .in 5
1345 .nf
1346                      1                   2                   3
1347  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1348 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1349 |          Notify Type          |        Payload Length         |
1350 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1351 | Argument Nums |
1352 +-+-+-+-+-+-+-+-+
1353 .in 3
1354
1355 .ce
1356 Figure 13:  Notify Payload
1357
1358
1359 .in 6
1360 o Notify Type (2 bytes) - Indicates the type of the notify
1361   message.
1362
1363 o Payload Length (2 bytes) - Length of the entire Notify Payload
1364   including any associated Argument Payloads.
1365
1366 o Argument Nums (1 byte) - Indicates the number of Argument
1367   Payloads associated to this payload.  Notify types may define
1368   arguments to be sent along the notify message.
1369 .in 3
1370
1371 Following the list of currently defined notify types.  The format for
1372 notify arguments is same as in SILC commands described in [SILC4].
1373 Note that all IDs sent in arguments are sent inside ID Payload.  Also
1374 note that all strings sent as arguments MUST be UTF-8 [RFC3629] encoded,
1375 unless otherwise defined.  Also note that all public keys or
1376 certificates sent inside arguments are actually Public Key Payloads.
1377
1378
1379 .in 6
1380 0     SILC_NOTIFY_TYPE_NONE
1381
1382       If no specific notify type apply for the notify message this type
1383       MAY be used.
1384
1385       Max Arguments:  1
1386           Arguments:  (1) <message>
1387
1388       The <message> is implementation specific free text string.
1389       Receiver MAY ignore this message.
1390
1391
1392 1     SILC_NOTIFY_TYPE_INVITE
1393
1394       Sent when an client is invited to a channel.  This is also sent
1395       when the invite list of the channel is changed.  This notify type
1396       is sent to local servers on the channel, but MUST NOT be sent
1397       to clients on the channel.  Router MUST broadcast this to its
1398       primary router and to local servers on the channel.  When a client
1399       was directly invited to the channel this is also sent to that
1400       client.  In this case the packet is destined to the client.
1401
1402       Max Arguments:  5
1403           Arguments:  (1) <Channel ID>          (2) <channel name>
1404                       (3) [<sender Client ID>]  (4) [<add | del>]
1405                       (5) [<invite list>]
1406
1407       The <Channel ID> is the channel.  The <channel name> is the name
1408       of the channel and is provided because the client which receives
1409       this notify packet may not have a way to resolve the name of the
1410       channel from the <Channel ID>.  The <sender Client ID> is the
1411       Client ID which invited the client to the channel.  The
1412       <add | del> is an argument of size of 1 byte where 0x00 means
1413       adding a client to invite list, and 0x01 means deleting a client
1414       from invite list.  The <invite list>, if present, indicates the
1415       information to be added to or removed from the invite list.
1416       The <invite list> format is defined in [SILC4] with
1417       SILC_COMMAND_INVITE command.  When this notify is destined to
1418       a client the <add | del> and <invite list> MUST NOT be sent.
1419       When <add | del> is used  to announce information during server
1420       connecting phase the argument type MUST be 0x03.  See section
1421       4.2.1 in [SILC1] for more information.
1422
1423
1424 2     SILC_NOTIFY_TYPE_JOIN
1425
1426       Sent when client has joined to a channel.  The server MUST
1427       distribute this type to the local clients on the channel and then
1428       send it to its primary router.  Note that, when router is joining
1429       the client on behalf of normal server then router MUST send this
1430       notify type locally and globally.  The router or server receiving
1431       the packet distributes this type to the local clients on the
1432       channel and broadcast it to the network.  This notify is sent
1433       also to the client that joined the channel.
1434
1435       Max Arguments:  2
1436           Arguments:  (1) [<Client ID>]       (2) <Channel ID>
1437
1438       The <Client ID> is the client that joined to the channel
1439       indicated by the <Channel ID>.
1440
1441
1442 3     SILC_NOTIFY_TYPE_LEAVE
1443
1444       Sent when client has left a channel.  The server must distribute
1445       this type to the local clients on the channel and then send it
1446       to its primary router.  The router or server receiving the
1447       packet distributes this type to the local clients on the channel
1448       and broadcast it to the network.  This notify MUST NOT be sent to
1449       the leaving client.
1450
1451       Max Arguments:  1
1452           Arguments:  (1) <Client ID>
1453
1454       The <Client ID> is the client which left the channel.
1455
1456
1457 4     SILC_NOTIFY_TYPE_SIGNOFF
1458
1459       Sent when client signoff from SILC network.  The server MUST
1460       distribute this type to the local clients on the channel and
1461       then send it to its primary router.  The router or server
1462       receiving the packet distributes this type to the local clients
1463       on the channel and broadcast it to the network.  This notify
1464       MUST NOT be sent to the quitting client.  The Destination ID
1465       in the packet may be any ID depending to who it is destined.
1466
1467       Max Arguments:  2
1468           Arguments:  (1) <Client ID>  (2) <message>
1469
1470       The <Client ID> is the client which left SILC network.  The
1471       <message> is free text string indicating the reason of the
1472       signoff.
1473
1474
1475 5     SILC_NOTIFY_TYPE_TOPIC_SET
1476
1477       Sent when topic is set/changed on a channel.  This type may be
1478       sent only to the clients which are joined on the channel which
1479       topic was just set or changed.  The packet is destined to the
1480       channel.
1481
1482       Max Arguments:  2
1483           Arguments:  (1) <ID Payload>  (2) <topic>
1484
1485       The <ID Payload> is the ID of the entity who set the topic.
1486       It usually is Client ID but it can be Server ID and Channel ID
1487       as well.
1488
1489
1490 6     SILC_NOTIFY_TYPE_NICK_CHANGE
1491
1492       Sent when client changes nick on a channel.  The server MUST
1493       distribute this type only to the local clients on the channel
1494       and then send it to its primary router.  The router or server
1495       receiving the packet distributes this type to the local clients
1496       on the channel and broadcast it to the network.  This packet is
1497       destined directly to the sent entity.  This MUST be sent to those
1498       clients that are joined on same channels as the client that
1499       changed the nickname.  This notify MUST NOT be sent multiple
1500       times to the same recipient.  This notify MUST be sent also to
1501       the client that changed the nickname.
1502
1503       Max Arguments:  3
1504           Arguments:  (1) <Old Client ID>  (2) <New Client ID>
1505                       (3) <nickname>
1506
1507       The <Old Client ID> is the old ID of the client which changed
1508       the nickname.  The <New Client ID> is the new ID generated by
1509       the change of the nickname.  The <nickname> is the new nickname.
1510       Note that it is possible to send this notify even if the
1511       nickname has not changed, but client ID was changed.
1512
1513
1514 7     SILC_NOTIFY_TYPE_CMODE_CHANGE
1515
1516       Sent when channel mode has changed.  This type MUST be sent only
1517       to the clients which are joined on the channel which mode was
1518       changed.  This packet is destined to the channel.
1519
1520       Max Arguments:  8
1521           Arguments:  (1) <ID Payload>       (2) <mode mask>
1522                       (3) [<cipher>]         (4) <[hmac>]
1523                       (5) [<passphrase>]     (6) [<founder public key>]
1524                       (7) [<channel pubkey>] (8) [<user limit>]
1525
1526       The <ID Payload> is the ID (usually Client ID but it can be
1527       Server ID as well when the router is enforcing channel mode
1528       change) of the entity which changed the mode.  The <mode mask>
1529       is the new mode mask of the channel.  The client can safely
1530       ignore the <cipher> argument since the SILC_PACKET_CHANNEL_KEY
1531       packet will force the new channel key change anyway.  The <hmac>
1532       argument is important since the client is responsible of setting
1533       the new HMAC and the hmac key into use.  The <passphrase> is
1534       the passphrase of the channel, if it was now set.  The <founder
1535       public key> argument is sent when the founder mode on the
1536       channel was set.  All routers and servers that receive the packet
1537       MUST save the founder's public key so that the founder can
1538       reclaim the channel founder rights back for the channel on any
1539       server in the network.  The <user limit> argument is present when
1540       the user limit was set or changed on the channel.
1541
1542       The <channel pubkey> is an Argument List Payload and it is used
1543       to add and/or remove channel public keys from the channel.  Also,
1544       when announcing channel information between servers and routers
1545       during connecting phase this argument includes the list of channel
1546       public keys.  To add a public key to channel public key list the
1547       SILC_CMODE_CHANNEL_AUTH mode is set and the argument type is 0x00,
1548       and the argument is the public key.  To remove a public key from
1549       the channel public key list the argument type is 0x01, and the
1550       argument is the public key to be removed.  If the mode
1551       SILC_CMODE_CHANNEL_AUTH is unset (and was set earlier) all public
1552       keys are removed at once.  Implementation MAY add and remove
1553       multiple public keys at the same time by including multiple
1554       arguments to the <channel pubkey> Argument List Payload where each
1555       argument is one Public Key Payload.  When <channel pubkey> is used
1556       to announce information during server connecting phase the
1557       argument type MUST be 0x03.  See section 4.2.1 in [SILC1] for
1558       more information.
1559
1560
1561 8     SILC_NOTIFY_TYPE_CUMODE_CHANGE
1562
1563       Sent when user mode on channel has changed.  This type MUST be
1564       sent only to the clients which are joined on the channel where
1565       the target client is on.  This packet is destined to the channel.
1566
1567       Max Arguments:  4
1568           Arguments:  (1) <ID Payload>        (2) <mode mask>
1569                       (3) <Target Client ID>  (4) [<founder pubkey>]
1570
1571       The <ID Payload> is the ID (usually Client ID but it can be
1572       Server ID as well when the router is enforcing user's mode
1573       change) of the entity which changed the mode.  The <mode mask>
1574       is the new mode mask of the channel.  The <Target Client ID>
1575       is the client which mode was changed.  The <founder pubkey>
1576       is the public key of the channel founder and may be sent only
1577       when first time setting the channel founder mode using the
1578       SILC_COMMAND_CUMODE command, and when sending this notify.
1579
1580
1581 9     SILC_NOTIFY_TYPE_MOTD
1582
1583       Sent when Message of the Day (motd) is sent to a client.
1584
1585       Max Arguments:  1
1586           Arguments:  (1) <motd>
1587
1588       The <motd> is the Message of the Day.  This notify MAY be
1589       ignored and is OPTIONAL.
1590
1591
1592 10    SILC_NOTIFY_TYPE_CHANNEL_CHANGE
1593
1594       Sent when channel's ID has changed for a reason or another.
1595       This is sent by normal server to the client.  This can also be
1596       sent by router to other server to force the Channel ID change.
1597       The Channel ID MUST be changed to use the new one.  When sent
1598       to clients, this type MUST be sent only to the clients which are
1599       joined on the channel.  This packet is destined to the sent
1600       entity.
1601
1602       Max Arguments:  2
1603           Arguments:  (1) <Old Channel ID>  (2) <New Channel ID>
1604
1605       The <Old Channel ID> is the channel's old ID and the <New
1606       Channel ID> is the new one that MUST replace the old one.
1607       Server which receives this from router MUST re-announce the
1608       channel to the router by sending SILC_PACKET_NEW_CHANNEL packet
1609       with the new Channel ID.
1610
1611
1612 11    SILC_NOTIFY_TYPE_SERVER_SIGNOFF
1613
1614       Sent when server quits SILC network.  Those clients from this
1615       server that are on channels must be removed from the channel.
1616       This packet is destined to the sent entity.
1617
1618       Max Arguments:  256
1619           Arguments:  (1) <Server ID>   (n) [<Client ID>]   [...]
1620
1621       The <Server ID> is the server's ID.  The rest of the arguments
1622       are the Client IDs of the clients which are coming from this
1623       server and are thus quitting the SILC network also.  If the
1624       maximum number of arguments are reached another
1625       SILC_NOTIFY_TYPE_SERVER_SIGNOFF notify packet MUST be sent.
1626       When this notify packet is sent between routers the Client ID's
1627       MAY be omitted.  Server receiving the Client ID's in the payload
1628       may use them directly to remove the client.
1629
1630
1631 12    SILC_NOTIFY_TYPE_KICKED
1632
1633       Sent when a client has been kicked from a channel.  This MUST
1634       also be sent to the client which was kicked from the channel.
1635       The client which was kicked from the channel MUST be removed
1636       from the channel.  The client MUST also be removed from channel's
1637       invite list if it is explicitly added in the list.  This packet
1638       is destined to the channel.  The router or server receiving the
1639       packet distributes this type to the local clients on the channel
1640       and broadcast it to the network.
1641
1642       Max Arguments:  3
1643           Arguments:  (1) <Client ID>           (2) [<comment>]
1644                       (3) <Kicker's Client ID>
1645
1646       The <Client ID> is the client which was kicked from the channel.
1647       The kicker may have set the <comment> string to indicate the
1648       reason for the kicking.  The <Kicker's Client ID> is the kicker.
1649
1650
1651 13    SILC_NOTIFY_TYPE_KILLED
1652
1653       Sent when a client has been killed from the network.  This MUST
1654       also be sent to the client which was killed from the network.
1655       This notify MUST be sent to those clients which are joined on
1656       same channels as the killed client.  The client which was killed
1657       MUST be removed from the network.  This packet is destined
1658       directly to the sent entity.  The router or server receiving
1659       the packet distributes this type to the local clients on the
1660       channel and broadcast it to the network.  The client MUST also
1661       be removed from joined channels invite list if it is explicitly
1662       added in the lists.  This notify MUST NOT be sent multiple
1663       times to same recipient.
1664
1665       Max Arguments:  3
1666           Arguments:  (1) <Client ID>           (2) [<comment>]
1667                       (3) <Killer's ID>
1668
1669       The <Client ID> is the client which was killed from the network.
1670       The killer may have set the  <comment> string to indicate the
1671       reason for the killing.  The <Killer's ID> is the killer, which
1672       may be client but also router server.
1673
1674
1675 14    SILC_NOTIFY_TYPE_UMODE_CHANGE
1676
1677       Sent when user's mode in the SILC changes.  This type is sent
1678       only between routers as broadcast packet.
1679
1680       Max Arguments:  2
1681           Arguments:  (1) <Client ID>  (2) <mode mask>
1682
1683       The <Client ID> is the client which mode was changed.  The
1684       <mode mask> is the new mode mask.
1685
1686
1687 15    SILC_NOTIFY_TYPE_BAN
1688
1689       Sent when the ban list of the channel is changed.  This notify
1690       type is sent to local servers on the channel, but MUST NOT be
1691       sent to clients on the channel.  Router MUST broadcast this to
1692       its primary router and to local servers on the channel.
1693
1694       Max Arguments:  3
1695           Arguments:  (1) <Channel ID>         (2) [<add | del>]
1696                       (3) [<ban list>]
1697
1698       The <Channel ID> is the channel which ban list was changed.
1699       The <add | del> is an argument of size of 1 byte where 0x00 means
1700       adding a client to ban list, and 0x01 means deleting a client
1701       from ban list.  The <ban list> indicates the information to be
1702       added to or removed from the ban list.  The <ban list> format
1703       format is defined in [SILC4] with SILC_COMMAND_BAN command.
1704       When <add | del> is used  to announce information during server
1705       connecting phase the argument type MUST be 0x03.  See section
1706       4.2.1 in [SILC1] for more information.
1707
1708
1709 16    SILC_NOTIFY_TYPE_ERROR
1710
1711       Sent when an error occurs during processing some SILC procedure.
1712       This is not used when error occurs during command processing, see
1713       [SILC4] for more information about commands and command replies.
1714       This type is sent directly to the sender of the packet whose
1715       packet caused the error.  See [SILC1] for definition when this
1716       type can be sent.
1717
1718       Max Arguments:  256
1719           Arguments:  (1) <Status Type>        (n) [...]
1720
1721       The <Status Type> is the error type defined in [SILC4].  Note
1722       that same types are also used with command replies to indicate
1723       the status of a command.  Both commands and this notify type
1724       share same status types.  Rest of the arguments are status type
1725       dependent and are specified with those status types that can be
1726       sent currently inside this notify type in [SILC4].  The <Status
1727       Type> is size of 1 byte.
1728
1729
1730 17    SILC_NOTIFY_TYPE_WATCH
1731
1732       Sent to indicate change in a watched user.  Client can set
1733       nicknames to be watched with SILC_COMMAND_WATCH command, and
1734       receive notifications when they login to network, signoff from
1735       the network or their user mode is changed.  This notify type
1736       is used to deliver these notifications.  The notify type is
1737       sent directly to the watching client.
1738
1739       Max Arguments:  5
1740           Arguments:  (1) <Client ID>        (2) [<nickname>]
1741                       (3) <user mode>        (4) [<Notify Type>]
1742                       (5) [<public key>]
1743
1744       The <Client ID> is the user's Client ID which is being watched,
1745       and the <nickname> is its nickname.  If the client just
1746       changed the nickname, then <nickname> is the new nickname, but
1747       the <Client ID> is the old client ID.  The <user mode> is the
1748       user's current user mode.  The <Notify Type> can be same as the
1749       Notify Payload's Notify Type, and is 16 bit MSB first order
1750       value.  If provided it may indicate the notify that occurred
1751       for the client.  If client logged in to the network the
1752       <Notify Type> MUST NOT be present.  The <public key> MAY be
1753       present, and it is the public key of the client being watched.
1754 .in 3
1755
1756 Notify types starting from 16384 are reserved for private notify
1757 message types.
1758
1759 Router server which receives SILC_NOTIFY_TYPE_SIGNOFF,
1760 SILC_NOTIFY_TYPE_SERVER_SIGNOFF, SILC_NOTIFY_TYPE_KILLED,
1761 SILC_NOTIFY_TYPE_NICK_CHANGE and SILC_NOTIFY_TYPE_UMODE_CHANGE
1762 MUST check whether someone in the local cell is watching the nickname
1763 the client has, and send the SILC_NOTIFY_TYPE_WATCH notify to the
1764 watcher, unless the watched client in case has the user mode
1765 SILC_UMODE_REJECT_WATCHING set.  If the watcher client and the client
1766 that was watched is same the notify SHOULD NOT be sent.
1767
1768
1769 .ti 0
1770 2.3.8 Error Payload
1771
1772 Error payload is sent upon error in protocol.  Error may occur in
1773 various conditions when server sends this packet.  Client MUST NOT
1774 send this payload but MUST be able to accept it.  However, client
1775 MAY ignore the contents of the packet as server is going to take
1776 action on the error anyway.  However, it is recommended that the
1777 client takes error packet seriously.
1778
1779
1780 .in 5
1781 .nf
1782                      1                   2                   3
1783  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1784 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1785 |                                                               |
1786 ~                         Error Message                         ~
1787 |                                                               |
1788 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1789 .in 3
1790
1791 .ce
1792 Figure 14:  Error Payload
1793
1794
1795 .in 6
1796 o Error Message (variable length) - Human readable error
1797   message.
1798 .in 3
1799
1800
1801 .ti 0
1802 2.3.9 Channel Message Payload
1803
1804 Channel Message Payload is used to send message to channels, a group
1805 of users.  These messages can only be sent if client has joined to
1806 some channel.  Even though this packet is very common in SILC it
1807 is still special packet.  Some special handling on sending and
1808 reception of channel message is required.
1809
1810 Padding MUST be applied into this payload since the payload is
1811 encrypted separately from other parts of the packet with the
1812 channel specific key.  Hence the requirement of the padding.
1813 The packet MUST be made multiple by eight (8) or by the block
1814 size of the cipher, which ever is larger.
1815
1816 The SILC header in this packet is encrypted with the session key
1817 of the next receiver of the packet.  Nothing else is encrypted
1818 with that key.  Thus, the actual packet and padding to be
1819 encrypted with the session key is SILC Header plus padding to it.
1820
1821 Receiver of the the channel message packet is able to determine
1822 the channel the message is destined to by checking the Destination
1823 ID from the SILC Packet header which tells the destination channel.
1824 The original sender of the packet is also determined by checking
1825 the source ID from the header which tells the client which sent
1826 the message.  The Destination ID MUST be Channel ID in the SILC
1827 Packet header.
1828
1829 This packet use generic Message Payload as Channel Message Payload.
1830 See section 2.3.2.6 for generic Message Payload.
1831
1832
1833 .ti 0
1834 2.3.10 Channel Key Payload
1835
1836 All traffic in channels are protected by channel specific keys.
1837 Channel Key Payload is used to distribute channel keys to all
1838 clients on the particular channel.  Channel keys are sent when
1839 the channel is created, when new user joins to the channel and
1840 whenever a user has left a channel.  Server creates the new
1841 channel key and distributes it to the clients by encrypting this
1842 payload with the session key shared between the server and
1843 the client.  After that, client MUST start using the key received
1844 in this payload to protect the traffic on the channel.
1845
1846 The client which is joining to the channel receives its key in the
1847 SILC_COMMAND_JOIN command reply message thus it is not necessary to
1848 send this payload to the entity which sent the SILC_COMMAND_JOIN
1849 command.
1850
1851 Channel keys are cell specific thus every router in the cell have
1852 to create a channel key and distribute it if any client in the
1853 cell has joined to a channel.  Channel traffic between cell's
1854 are not encrypted using channel keys, they are encrypted using
1855 normal session keys between two routers.  Inside a cell, all
1856 channel traffic is encrypted with the specified channel key.
1857 Channel key SHOULD expire periodically, say, in one hour, in
1858 which case new channel key is created and distributed.
1859
1860 Note that, this packet is not used if SILC_CMODE_PRIVKEY mode is set
1861 on channel.  This means that channel uses channel private keys which
1862 are not server generated.  For this reason server cannot send this
1863 packet as it does not know the key.
1864
1865 The destination ID in the packet SHOULD be the entity to whom the
1866 packet is sent.  Using Channel ID as destination ID is not
1867 necessary as the Channel ID is included in the Channel Key Payload.
1868
1869 The payload may only be sent with SILC_PACKET_CHANNEL_KEY packet.
1870 It MUST NOT be sent in any other packet type.  The following diagram
1871 represents the Channel Key Payload.
1872
1873
1874
1875 .in 5
1876 .nf
1877                      1                   2                   3
1878  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1879 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1880 |       Channel ID Length       |                               |
1881 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1882 |                                                               |
1883 ~                          Channel ID                           ~
1884 |                                                               |
1885 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1886 |      Cipher Name Length       |                               |
1887 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1888 |                                                               |
1889 ~                         Cipher Name                           ~
1890 |                                                               |
1891 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1892 |      Channel Key Length       |                               |
1893 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1894 |                                                               |
1895 ~                         Channel Key                           ~
1896 |                                                               |
1897 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1898 .in 3
1899
1900 .ce
1901 Figure 15:  Channel Key Payload
1902
1903
1904
1905 .in 6
1906 o Channel ID Length (2 bytes) - Indicates the length of the
1907   Channel ID field in the payload, not including any other
1908   field.
1909
1910 o Channel ID (variable length) - The Channel ID of the
1911   channel.
1912
1913 o Cipher Name Length (2 bytes) - Indicates the length of the
1914   Cipher name field in the payload, not including any other
1915   field.
1916
1917 o Cipher Name (variable length) - Name of the cipher used
1918   in the protection of channel traffic.  This name is
1919   initially decided by the creator of the channel but it
1920   may change during the life time of the channel as well.
1921
1922 o Channel Key Length (2 bytes) - Indicates the length of the
1923   Channel Key field in the payload, not including any other
1924   field.
1925
1926 o Channel Key (variable length) - The actual channel key
1927   material.  See [SILC1] on how to start using the key.
1928 .in 3
1929
1930
1931 .ti 0
1932 2.3.11 Private Message Payload
1933
1934 Private Message Payload is used to send private message between
1935 two clients.  The messages are sent only to the specified user
1936 and no other user inside SILC network is able to see the message.
1937
1938 The message can be protected by the session key established by the
1939 SILC Key Exchange Protocol.  However, it is also possible to agree
1940 to use a private message key to protect just the private messages.
1941 It is for example possible to perform Key Agreement between two
1942 clients.  See section 2.3.20 Key Agreement Payload how to perform
1943 key agreement.  It is also possible to use static or pre-shared keys
1944 to protect private messages.  See the 2.3.12 Private Message Key
1945 Payload and [SILC1] section 4.6 for detailed description for private
1946 message key generation.
1947
1948 If normal session key is used to protect the message, every server
1949 between the sender client and the receiving client MUST decrypt the
1950 packet and always re-encrypt it with the session key of the next
1951 receiver of the packet.  See section Client To Client in [SILC1].
1952
1953 When the private message key is used, and the Private Message Key
1954 flag was set in the SILC Packet header no server or router en route
1955 is able to decrypt or re-encrypt the packet.  In this case only the
1956 SILC Packet header is processed by the servers and routers en route.
1957 Section Client To Client in [SILC1] gives example of this scheme.
1958
1959 This packet use generic Message Payload as Private Message Payload.
1960 See section 2.3.2.6 for generic Message Payload.
1961
1962
1963 .ti 0
1964 2.3.12 Private Message Key Payload
1965
1966 This payload is OPTIONAL and can be used to indicate that a static
1967 or pre-shared key should be used in the private message communication
1968 to protect the messages.  The actual key material has to be sent
1969 outside the SILC network, or it has to be a static or pre-shared key.
1970 The sender of this packet is considered to be the initiator and the
1971 receiver the responder when processing the raw key material as
1972 described in the section 4.6 in [SILC1] and in the section 2.3 in
1973 [SILC3].
1974
1975 Note that it is also possible to use static or pre-shared keys in
1976 client implementations without sending this packet.  Clients may
1977 naturally agree to use a key without sending any kind of indication
1978 to each other.  The key may be for example a long-living static key
1979 that the clients has agreed to use at all times.  Note that it is
1980 also possible to agree to use private message key by performing
1981 a Key Agreement.  See the section 2.3.20 Key Agreement Payload.
1982
1983 This payload may only be sent by client to another client.  Server
1984 MUST NOT send this payload.  After sending this payload and setting the
1985 key into use this payload the sender of private messages MUST set the
1986 Private Message Key flag into the SILC Packet Header.
1987
1988 The payload may only be sent with SILC_PACKET_PRIVATE_MESSAGE_KEY
1989 packet.  It MUST NOT be sent in any other packet type.  The following
1990 diagram represents the Private Message Key Payload.
1991
1992
1993 .in 5
1994 .nf
1995                      1                   2                   3
1996  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
1997 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1998 |      Cipher Name Length       |                               |
1999 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2000 |                                                               |
2001 ~                          Cipher Name                          ~
2002 |                                                               |
2003 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2004 |       HMAC Name Length        |                               |
2005 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2006 |                                                               |
2007 ~                           HMAC Name                           ~
2008 |                                                               |
2009 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2010 .in 3
2011
2012 .ce
2013 Figure 16:  Private Message Key Payload
2014
2015
2016
2017 .in 6
2018 o Cipher Name Length (2 bytes) - Indicates the length of the
2019   Cipher Name field in the payload, not including any other
2020   field.
2021
2022 o Cipher Name (variable length) - Name of the cipher to use
2023   in the private message encryption.  If this field does not
2024   exist then the default cipher of the SILC protocol is used.
2025   See the [SILC1] for defined ciphers.
2026
2027 o HMAC Name Length (2 bytes) - Indicates the length of the
2028   HMAC Name field in the payload, not including any other
2029   field.
2030
2031 o HMAC Name (variable length) - Name of the HMAC to use
2032   in the private message MAC computation.  If this field does
2033   not exist then the default HMAC of the SILC protocol is used.
2034   See the [SILC1] for defined HMACs.
2035 .in 3
2036
2037
2038 .ti 0
2039 2.3.13 Command Payload
2040
2041 Command Payload is used to send SILC commands from client to server.
2042 Also server MAY send commands to other servers.  The following diagram
2043 represents the Command Payload.
2044
2045
2046 .in 5
2047 .nf
2048                      1                   2                   3
2049  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2050 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2051 |         Payload Length        | SILC Command  | Arguments Num |
2052 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2053 |       Command Identifier      |
2054 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2055 .in 3
2056
2057 .ce
2058 Figure 17:  Command Payload
2059
2060
2061 .in 6
2062 o Payload Length (2 bytes) - Length of the entire command
2063   payload including any command argument payloads associated
2064   with this payload.
2065
2066 o SILC Command (1 byte) - Indicates the SILC command.  This MUST
2067   be set to non-zero value.  If zero (0) value is found in this
2068   field the packet MUST be discarded.
2069
2070 o Arguments Num (1 byte) - Indicates the number of arguments
2071   associated with the command.  If there are no arguments this
2072   field is set to zero (0).  The arguments MUST follow the
2073   Command Payload.  See section 2.3.2.2 for definition of the
2074   Argument Payload.
2075
2076 o Command Identifier (2 bytes) - Identifies this command at the
2077   sender's end.  The entity which replies to this command MUST
2078   set the value found from this field into the Command Payload
2079   used to send the reply to the sender.  This way the sender
2080   can identify which command reply belongs to which originally
2081   sent command.  What this field includes is implementation
2082   issue but it is RECOMMENDED that wrapping counter value is
2083   used in the field.
2084 .in 3
2085
2086 See [SILC4] for detailed description of different SILC commands,
2087 their arguments and their reply messages.
2088
2089
2090 .ti 0
2091 2.3.14 Command Reply Payload
2092
2093 Command Reply Payload is used to send replies to the commands.  The
2094 Command Reply Payload is identical to the Command Payload thus see
2095 the 2.3.13 section for the payload specification.
2096
2097 The entity which sends the reply packet MUST set the Command Identifier
2098 field in the reply packet's Command Payload to the value it received
2099 in the original command packet.
2100
2101 See SILC Commands in [SILC4] for detailed description of different
2102 SILC commands, their arguments and their reply messages.
2103
2104
2105 .ti 0
2106 2.3.15 Connection Auth Request Payload
2107
2108 Client MAY send this payload to server to request the authentication
2109 method that must be used in authentication protocol.  If client knows
2110 this information beforehand this payload is not necessary to be sent.
2111 Server performing authentication with another server MAY also send
2112 this payload to request the authentication method.  If the connecting
2113 server already knows this information this payload is not necessary
2114 to be sent.
2115
2116 Server receiving this request SHOULD reply with same payload sending
2117 the mandatory authentication method.  Algorithms that may be required
2118 to be used by the authentication method are the ones already
2119 established by the SILC Key Exchange protocol.  See section Key
2120 Exchange Start Payload in [SILC3] for detailed information.
2121
2122 The payload may only be sent with SILC_PACKET_CONNECTION_AUTH_REQUEST
2123 packet.  It MUST NOT be sent in any other packet type.  The following
2124 diagram represents the Connection Auth Request Payload.
2125
2126
2127 .in 5
2128 .nf
2129                      1                   2                   3
2130  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2131 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2132 |        Connection Type        |     Authentication Method     |
2133 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2134 .in 3
2135
2136 .ce
2137 Figure 18:  Connection Auth Request Payload
2138
2139
2140 .in 6
2141 o Connection Type (2 bytes) - Indicates the type of the
2142   connection.  The following connection types are defined:
2143
2144
2145      1    Client connection
2146      2    Server connection
2147      3    Router connection
2148
2149   If any other type is found in this field the packet MUST be
2150   discarded and the authentication MUST be failed.
2151
2152 o Authentication Method (2 bytes) - Indicates the authentication
2153   method to be used in the authentication protocol.  The following
2154   authentication methods are defined:
2155
2156      0    NONE        (mandatory)
2157      1    password    (mandatory)
2158      2    public key  (mandatory)
2159
2160   If any other type is found in this field the packet MUST be
2161   discarded and the authentication MUST be failed.  If this
2162   payload is sent as request to receive the mandatory
2163   authentication method this field MUST be set to zero (0),
2164   indicating that receiver should send the mandatory
2165   authentication method.  The receiver sending this payload
2166   to the requesting party, MAY also set this field to zero (0)
2167   to indicate that authentication is not required.  In this
2168   case authentication protocol still MUST be started but
2169   server is most likely to respond with SILC_PACKET_SUCCESS
2170   immediately.
2171 .in 3
2172
2173
2174 .ti 0
2175 2.3.16 New ID Payload
2176
2177 New ID Payload is a multipurpose payload.  It is used to send newly
2178 created ID's from clients and servers.  When client connects to server
2179 and registers itself to the server by sending SILC_PACKET_NEW_CLIENT
2180 packet, server replies with this packet by sending the created ID for
2181 the client.  Server always creates the ID for the client.
2182
2183 This payload is also used when server tells its router that new client
2184 has registered to the SILC network.  In this case the server sends
2185 the Client ID of the client to the router.  Similarly when router
2186 distributes information to other routers about the client in the SILC
2187 network this payload is used.
2188
2189 Also, when server connects to router, router use this payload to inform
2190 other routers about new server in the SILC network.  However, every
2191 server (or router) creates their own ID's thus the ID distributed by
2192 this payload is not created by the distributor in this case.  Servers
2193 create their own ID's.  Server registers itself to the network by
2194 sending SILC_PACKET_NEW_SERVER to the router it connected to.  The case
2195 is same when router connects to another router.
2196
2197 This payload MUST NOT be used to send information about new channels.
2198 New channels are always distributed by sending the dedicated
2199 SILC_PACKET_NEW_CHANNEL packet.  Client MUST NOT send this payload.
2200 Both client and server (and router) MAY receive this payload.
2201
2202 The packet use generic ID Payload as New ID Payload.  See section
2203 2.3.2.1 for generic ID Payload.
2204
2205
2206 .ti 0
2207 2.3.17 New Client Payload
2208
2209 When client is connected to the server, keys has been exchanged and
2210 connection has been authenticated, client MUST register itself to the
2211 server.  Client's first packet after key exchange and authentication
2212 protocols MUST be SILC_PACKET_NEW_CLIENT.  This payload tells server all
2213 the relevant information about the connected user.  Server creates a new
2214 client ID for the client when received this payload and sends it to the
2215 client in New ID Payload.
2216
2217 This payload sends username and real name of the user on the remote host
2218 which is connected to the SILC server with SILC client.  The server
2219 creates the client ID according the information sent in this payload.
2220 The nickname of the user becomes the nickname sent in this payload.
2221
2222 The payload may only be sent with SILC_PACKET_NEW_CLIENT packet.  It
2223 MUST NOT be sent in any other packet type.  The following diagram
2224 represents the New Client Payload.
2225
2226
2227
2228 .in 5
2229 .nf
2230                      1                   2                   3
2231  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2232 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2233 |        Username Length        |                               |
2234 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2235 |                                                               |
2236 ~                           Username                            ~
2237 |                                                               |
2238 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2239 |       Real Name Length        |                               |
2240 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2241 |                                                               |
2242 ~                           Real Name                           ~
2243 |                                                               |
2244 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2245 .in 3
2246
2247 .ce
2248 Figure 19:  New Client Payload
2249
2250
2251 .in 6
2252 o Username Length (2 bytes) - Length of the Username field.
2253
2254 o Username (variable length) - The username of the user on
2255   the host where connecting to the SILC server.
2256
2257 o Real Name Length (2 bytes) - Length of the Real Name field.
2258
2259 o Real Name (variable length) - The real name of the user
2260   on the host where connecting to the SILC server.
2261 .in 3
2262
2263
2264 .ti 0
2265 2.3.18 New Server Payload
2266
2267 This payload is sent by server when it has completed successfully both
2268 key exchange and connection authentication protocols.  The server
2269 MUST register itself to the SILC Network by sending this payload.
2270 The first packet after these key exchange and authentication protocols
2271 is SILC_PACKET_NEW_SERVER packet.  The payload includes the Server ID
2272 of the server that it has created by itself.  It also includes a
2273 name of the server that is associated to the Server ID.
2274
2275 The payload may only be sent with SILC_PACKET_NEW_SERVER packet.  It
2276 MUST NOT be sent in any other packet type.  The following diagram
2277 represents the New Server Payload.
2278
2279
2280
2281
2282
2283 .in 5
2284 .nf
2285                      1                   2                   3
2286  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2287 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2288 |       Server ID Length        |                               |
2289 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2290 |                                                               |
2291 ~                        Server ID Data                         ~
2292 |                                                               |
2293 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2294 |     Server Name Length        |                               |
2295 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2296 |                                                               |
2297 ~                          Server Name                          ~
2298 |                                                               |
2299 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2300 .in 3
2301
2302 .ce
2303 Figure 20:  New Server Payload
2304
2305
2306 .in 6
2307 o Server ID Length (2 bytes) - Length of the Server ID Data
2308   field.
2309
2310 o Server ID Data (variable length) - The encoded Server ID
2311   data.
2312
2313 o Server Name Length (2 bytes) - Length of the server name
2314   field.
2315
2316 o Server Name (variable length) - The server name string.
2317 .in 3
2318
2319
2320 .ti 0
2321 2.3.19 New Channel Payload
2322
2323 Information about newly created channel is broadcasted to all routers
2324 in the SILC network by sending this packet payload.  Channels are
2325 created by router of the cell.  Server never creates channels unless
2326 it is a standalone server and it does not have router connection,
2327 in this case server acts as router.  Normal server send JOIN command
2328 to the router (after it has received JOIN command from client) which
2329 then processes the command and creates the channel.  Client MUST NOT
2330 send this packet.  Server MAY send this packet to a router when it is
2331 announcing its existing channels to the router after it has connected
2332 to the router.
2333
2334 The packet use generic Channel Payload as New Channel Payload.  See
2335 section 2.3.2.3 for generic Channel Payload.  The Mode Mask field in the
2336 Channel Payload is the mode of the channel.
2337
2338
2339 .ti 0
2340 2.3.20 Key Agreement Payload
2341
2342 This payload is used by clients to request key negotiation between
2343 another client in the SILC Network.  The key agreement protocol used
2344 is the SKE protocol.  The result of the protocol, the secret key
2345 material, can be used for example as private message key between the
2346 two clients.  This significantly adds security as the clients agree
2347 about the key without any server interaction.  The protocol is executed
2348 peer to peer.  The server and router MUST NOT send this payload.
2349
2350 The sender MAY tell the receiver of this payload the hostname and the
2351 port where the SKE protocol is running in the sender's end.  The
2352 receiver MAY then initiate the SKE negotiation with the sender.  The
2353 sender MAY also optionally not to include the hostname and the port
2354 of its SKE protocol.  In this case the receiver MAY reply to the
2355 request by sending the same payload filled with the receiver's hostname
2356 and the port where the SKE protocol is running.  The sender MAY then
2357 initiate the SKE negotiation with the receiver.
2358
2359 This payload may be sent with SILC_PACKET_KEY_AGREEMENT and
2360 SILC_PACKET_FTP packet types.  It MUST NOT be sent in any other packet
2361 types.  The following diagram represents the Key Agreement Payload.
2362
2363
2364 .in 5
2365 .nf
2366                      1                   2                   3
2367  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2368 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2369 |        Hostname Length        |                               |
2370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2371 |                                                               |
2372 ~                           Hostname                            ~
2373 |                                                               |
2374 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2375 |            Protocol           |             Port              |
2376 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2377 .in 3
2378
2379 .ce
2380 Figure 21:  Key Agreement Payload
2381
2382
2383 .in 6
2384 o Hostname Length (2 bytes) - Indicates the length of the
2385   Hostname field.
2386
2387 o Hostname (variable length) - The hostname or IP address where
2388   the SKE protocol is running, as UTF-8 encoded string.  The sender
2389   MAY fill this field when sending the payload.  If the receiver
2390   sends this payload as reply to the request it MUST fill this field.
2391
2392 o Protocol (2 bytes) - The internet protocol used for the key
2393   agreement connection.  Possible values are 0 for TCP and 1 for
2394   UDP.  Other values are unsupported.  This is a 16 bit MSB first
2395   order value.  If Hostname field is not present, the value in
2396   this field is ignored.
2397
2398 o Port (2 bytes) - The port where the SKE protocol is bound.
2399   The sender MAY fill this field when sending the payload.  If
2400   the receiver sends this payload as reply to the request it
2401   MUST fill this field.  This is a 16 bit MSB first order value.
2402 .in 3
2403
2404
2405 After the key material has been received from the SKE protocol it is
2406 processed as the [SILC3] describes.  If the key material is used as
2407 channel private key then the Sending Encryption Key, as defined in
2408 [SILC3] is used as the channel private key.  Other key material must
2409 be discarded.  The [SILC1] in section 4.6 defines the way to use the
2410 key material if it is intended to be used as private message keys.
2411 Any other use for the key material is undefined.
2412
2413
2414 .ti 0
2415 2.3.21 Resume Router Payload
2416
2417 See the [SILC1] for Resume Router protocol where this payload is
2418 used.  The payload may only be sent with SILC_PACKET_RESUME_ROUTER
2419 packet.  It MUST NOT be sent in any other packet type.  The following
2420 diagram represents the Resume Router Payload.
2421
2422
2423 .in 21
2424 .nf
2425                      1
2426  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2427 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2428 |      Type     |  Session ID   |
2429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2430 .in 3
2431
2432 .ce
2433 Figure 22:  Resume Router Payload
2434
2435
2436 .in 6
2437 o Type (1 byte) - Indicates the type of the backup resume
2438   protocol packet.  The type values are defined in [SILC1].
2439
2440 o Session ID (1 bytes) - Indicates the session ID for the
2441   backup resume protocol.  The sender of the packet sets this
2442   value and the receiver MUST set the same value in subsequent
2443   reply packet.
2444 .in 3
2445
2446
2447
2448
2449 .ti 0
2450 2.3.22 File Transfer Payload
2451
2452 File Transfer Payload is used to perform file transfer protocol between
2453 two entities in the network.  The actual file transfer protocol is always
2454 encapsulated inside the SILC Packet.  The actual data stream is also sent
2455 peer to peer outside SILC network.
2456
2457 When an entity, usually a client wishes to perform file transfer protocol
2458 with another client in the network, they perform Key Agreement protocol
2459 as described in the section 2.3.20 Key Agreement Payload and in [SILC3],
2460 inside File Transfer Payload.  After the Key Agreement protocol has been
2461 performed the subsequent packets in the data stream will be protected
2462 using the new key material.  The actual file transfer protocol is also
2463 initialized in this stage.  All file transfer protocol packets are always
2464 encapsulated in the File Transfer Payload and protected with the
2465 negotiated key material.
2466
2467 The payload may only be sent with SILC_PACKET_FTP packet.  It MUST NOT
2468 be sent in any other packet type.  The following diagram represents the
2469 File Transfer Payload.
2470
2471
2472 .in 5
2473 .nf
2474                      1                   2                   3
2475  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2476 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2477 |     Type      |                                               |
2478 +-+-+-+-+-+-+-+-+                                               +
2479 |                                                               |
2480 ~                             Data                              ~
2481 |                                                               |
2482 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2483 .in 3
2484
2485 .ce
2486 Figure 23:  File Transfer Payload
2487
2488
2489 .in 6
2490 o Type (1 byte) - Indicates the type of the file transfer
2491   protocol.  The following file transfer protocols has been
2492   defined:
2493
2494     1    Secure File Transfer Protocol (SFTP)  (mandatory)
2495
2496   If zero (0) value or any unsupported file transfer protocol
2497   type is found in this field the packet MUST be discarded.
2498   The currently mandatory file transfer protocol is SFTP.
2499   The SFTP protocol is defined in [SFTP].
2500
2501 o Data (variable length) - Arbitrary file transfer data.  The
2502   contents and encoding of this field is dependent of the usage
2503   of this payload and the type of the file transfer protocol.
2504   When this payload is used to perform the Key Agreement
2505   protocol, this field include the Key Agreement Payload,
2506   as defined in the section 2.3.20 Key Agreement Payload.
2507   When this payload is used to send the actual file transfer
2508   protocol data, the encoding is defined in the corresponding
2509   file transfer protocol.
2510 .in 3
2511
2512
2513 .ti 0
2514 2.3.23 Resume Client Payload
2515
2516 This payload is used by client to resume its detached session in the
2517 SILC Network.  A client is able to detach itself from the network by
2518 sending SILC_COMMAND_DETACH command to its server.  The network
2519 connection to the client is lost but the client remains as valid
2520 client in the network.  The client is able to resume the session back
2521 by sending this packet and including the old Client ID, and an
2522 Authentication Payload [SILC1] which the server use to verify with
2523 the detached client's public key.  This also implies that the
2524 mandatory authentication method is public key authentication.
2525
2526 Server or router that receives this from the client also sends this,
2527 without the Authentication Payload, to routers in the network so that
2528 they know the detached client has resumed.  Refer to the [SILC1] for
2529 detailed description how the detaching and resuming procedure is
2530 performed.
2531
2532 The payload may only be sent with SILC_PACKET_RESUME_CLIENT packet.  It
2533 MUST NOT be sent in any other packet type.  The following diagram
2534 represents the Resume Client Payload.
2535
2536 .in 5
2537 .nf
2538                      1                   2                   3
2539  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2540 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2541 |       Client ID Length        |                               |
2542 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
2543 |                                                               |
2544 ~                           Client ID                           ~
2545 |                                                               |
2546 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2547 |                                                               |
2548 ~                     Authentication Payload                    ~
2549 |                                                               |
2550 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2551 .in 3
2552
2553 .ce
2554 Figure 24:  Resume Client Payload
2555
2556
2557 .in 6
2558 o Client ID Length (1 byte) - The length of the Client ID
2559   field not including any other field.
2560
2561 o Client ID (variable length) - The detached client's Client
2562   ID.  The client that sends this payload must know the Client
2563   ID.
2564
2565 o Authentication Payload (variable length) - The authentication
2566   payload that the server will verify with the detached client's
2567   public key.  If the server doesn't know the public key, it must
2568   retrieve it for example with SILC_COMMAND_GETKEY command.
2569 .in 3
2570
2571
2572 .ti 0
2573 2.3.24 Acknowledgement Payload
2574
2575 This payload is used to acknowledge a packet that had the Acknowledgement
2576 packet flag set.  The payload includes the sequence number of the packet
2577 that had the flag set, which the recipient can use to identify that the
2578 packet was acknowledged.
2579
2580 The payload may only be sent with SILC_PACKET_ACK packet.  It
2581 MUST NOT be sent in any other packet type.  The following diagram
2582 represents the Acknowledgement Payload.
2583
2584 .in 5
2585 .nf
2586                      1                   2                   3
2587  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
2588 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2589 |                    Packet Sequence Number                     |
2590 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2591 .in 3
2592
2593 .ce
2594 Figure 24:  Resume Client Payload
2595
2596
2597 .in 6
2598 o Packet Sequence Number (4 bytes) - The packet sequence number
2599   of the packet that had the Acknowledgement flag set.
2600 .in 3
2601
2602
2603 .ti 0
2604 2.4 SILC ID Types
2605
2606 ID's are used in the SILC network to associate different entities.
2607 The following ID's has been defined to be used in the SILC network.
2608
2609 .in 6
2610 0    No ID
2611
2612      This is used when other ID type is available at the time.
2613
2614 1    Server ID
2615
2616      Server ID to associate servers.  See the format of
2617      this ID in [SILC1].
2618
2619 2    Client ID
2620
2621      Client ID to associate clients.  See the format of
2622      this ID in [SILC1].
2623
2624 3    Channel ID
2625
2626      Channel ID to associate channels.  See the format of
2627      this ID in [SILC1].
2628 .in 3
2629
2630 When encoding different IDs into the ID Payload, all fields are always
2631 in MSB first order.  The IP address, port, and/or the random number
2632 are encoded in the MSB first order.
2633
2634
2635 .ti 0
2636 2.5 Packet Encryption And Decryption
2637
2638 SILC packets are encrypted almost entirely.  Only the MAC at the end
2639 of the packet is never encrypted.  The SILC Packet header is the first
2640 part of a packet to be encrypted and it is always encrypted with the
2641 key of the next receiver of the packet.  The data payload area of the
2642 packet is always entirely encrypted and it is usually encrypted with
2643 the next receiver's key.  However, there are some special packet types
2644 and packet payloads that require special encryption process.  These
2645 special cases are described in the next sections.  First is described
2646 the normal packet encryption process.
2647
2648
2649
2650 .ti 0
2651 2.5.1 Normal Packet Encryption And Decryption
2652
2653 Normal SILC packets are encrypted with the session key of the next
2654 receiver of the packet.  The entire SILC Packet header and the packet
2655 data payload is is encrypted with the same key.  Padding of the packet
2656 is also encrypted always with the session key, also in special cases.
2657 Computed MAC of the packet MUST NOT be encrypted.
2658
2659 Decryption process in these cases are straightforward.  The receiver
2660 of the packet MUST first decrypt the SILC Packet header, or some parts
2661 of it, usually first 16 bytes of it.  Then the receiver checks the
2662 packet type from the decrypted part of the header and can determine
2663 how the rest of the packet must be decrypted.  If the packet type is
2664 any of the special cases described in the following sections the packet
2665 decryption is special.  If the packet type is not among those special
2666 packet types rest of the packet can be decrypted with the same key.
2667 At this point the receiver is also able to determine the length of the
2668 packet.
2669
2670 With out a doubt, this sort of decryption processing causes some
2671 overhead to packet decryption, but never the less, is required.
2672
2673 The MAC of the packet is also verified at this point.  The MAC is
2674 computed from the ciphertext of the packet so it can be verified
2675 at this stage.  The length of the packet need to be known to be able
2676 to verify the MAC from the ciphertext so the first 16 bytes need to
2677 be decrypted to determine the packet length.  However, the MAC MUST
2678 be verified from the entire ciphertext.
2679
2680
2681 .ti 0
2682 2.5.2 Channel Message Encryption And Decryption
2683
2684 Channel Messages (Channel Message Payload) are always encrypted with
2685 the channel specific key.  However, the SILC Packet header is not
2686 encrypted with that key.  As in normal case, the header is encrypted
2687 with the key of the next receiver of the packet.  Note that, in this
2688 case the encrypted data area is not touched at all; it MUST NOT be
2689 re-encrypted with the session key.
2690
2691 Receiver of a channel message, who ever that is, is REQUIRED to decrypt
2692 the SILC Packet header to be able to recognize the packet to be as
2693 channel message.  This is same procedure as for normal SILC packets.
2694 As the receiver founds the packet to be channel message, rest of the
2695 packet processing is special.  Rest of the SILC Packet header is
2696 decrypted with the same session key along with the padding of the
2697 packet.  After that the packet is protected with the channel specific
2698 key and thus can be decrypted only if the receiver is the client on
2699 the channel.  See section 2.7 Packet Padding Generation for more
2700 information about padding on special packets.
2701
2702 If the receiver of the channel message is router which is routing the
2703 message to another router then it MUST decrypt the Channel Message
2704 payload too.  Between routers (that is, between cells) channel messages
2705 are protected with session keys shared between the routers.  This
2706 causes another special packet processing for channel messages.  If
2707 the channel message is received from another router then the entire
2708 packet, including Channel Message payload, MUST be encrypted with the
2709 session key shared between the routers.  In this case the packet
2710 decryption process is as with normal SILC packets.  Hence, if the
2711 router is sending channel message to another router the Channel
2712 Message payload MUST have been decrypted and MUST be re-encrypted
2713 with the session key shared between the another router.  In this
2714 case the packet encryption is as with any normal SILC packet.
2715
2716 It must be noted that this is only when the channel messages are sent
2717 from router to another router.  In all other cases the channel
2718 message encryption and decryption is as described before.  This
2719 different processing of channel messages with router to router
2720 connection is because channel keys are cell specific.  All cells have
2721 their own channel keys thus the channel message traveling from one
2722 cell to another MUST be protected as it would be any normal SILC
2723 packet.
2724
2725 If the SILC_CMODE_PRIVKEY channel mode has been set for the channel
2726 then the router cannot decrypt the packet as it does not know the
2727 private key.  In this case the entire packet MUST be encrypted with
2728 the session key and sent to the router.  The router receiving the
2729 packet MUST check the channel mode and decrypt the packet accordingly.
2730
2731
2732 .ti 0
2733 2.5.3 Private Message Encryption And Decryption
2734
2735 By default, private message in SILC are protected by session keys.
2736 In this case the private message encryption and decryption process is
2737 equivalent to normal packet encryption and decryption.
2738
2739 However, private messages MAY be protected with private message key
2740 which causes the packet to be special packet.  The procedure in this
2741 case is very much alike to channel packets.  The actual private message
2742 is encrypted with the private message key and other parts of the
2743 packet is encrypted with the session key.  See 2.7 Packet Padding
2744 Generation for more information about padding on special packets.
2745
2746 The difference from channel message processing is that server or router
2747 en route never decrypts the actual private message, as it does not
2748 have the key to do that.  Thus, when sending packets between router
2749 the processing is same as in any other case as well; the packet's header
2750 and padding is protected by the session key and the data area is not
2751 touched and is not re-encrypted.
2752
2753 The true receiver of the private message is able to decrypt the private
2754 message as it shares the key with the sender of the message.
2755
2756
2757 .ti 0
2758 2.6 Packet MAC Generation
2759
2760 Data integrity of a packet is protected by including a message
2761 authentication code (MAC) at the end of the packet.  The MAC is computed
2762 from shared secret MAC key, that is established by the SILC Key Exchange
2763 protocol, from packet sequence number, and from the encrypted packet
2764 data.  The MAC is always computed after packet is encrypted.  This is
2765 so called Encrypt-Then-MAC order; packet is first encrypted, then MAC
2766 is computed from the encrypted data.
2767
2768 The MAC is computed from entire packet.  Every bit of data in the packet,
2769 including SILC Packet Header is used in the MAC computing.  This way
2770 the entire packet becomes authenticated.
2771
2772 Hence, packet's MAC generation is as follows:
2773
2774   mac = MAC(key, sequence number | Encrypted SILC packet)
2775
2776 The MAC key is negotiated during the SKE protocol.  The sequence number
2777 is a 32 bit MSB first value starting from zero for first packet and
2778 increasing for subsequent packets, finally wrapping after 2^32 packets.
2779 The value is never reset, not even after rekey has been performed.
2780 However, rekey MUST be performed before the sequence number wraps
2781 and repeats from zero.  Note that the sequence number is incremented only
2782 when MAC is computed for a packet.  If packet is not encrypted and MAC is
2783 not computed then the sequence number is not incremented.  Hence, the
2784 sequence number is zero for the very first encrypted packet.
2785
2786 See [SILC1] for defined and allowed MAC algorithms.
2787
2788
2789 .ti 0
2790 2.7 Packet Padding Generation
2791
2792 Padding is needed in the packet because the packet is encrypted.  It
2793 always MUST be multiple by eight (8) or multiple by the block size
2794 of the cipher, which ever is larger.  The padding is always encrypted.
2795
2796 For normal packets the padding is added after the SILC Packet Header
2797 and between the Data Payload area.  The padding for normal packets
2798 may be calculated as follows:
2799
2800 .in 6
2801 padding_length = 16 - (packet_length mod block_size)
2802 if (padding_length < 8)
2803   padding_length += block_size
2804 .in 3
2805
2806 The `block_size' is the block size of the cipher.  The maximum padding
2807 length is 128 bytes, and minimum is 8 bytes.  For example, packets that
2808 include a passphrase or a password for authentication purposes SHOULD
2809 pad the packet up to the maximum padding length.  The maximum padding
2810 is calculated as follows:
2811
2812 .in 6
2813 padding_length = 128 - (packet_length mod block_size)
2814 .in 3
2815
2816 For special packets the padding calculation is different as special
2817 packets may be encrypted differently.  In these cases the encrypted
2818 data area MUST already be multiple by the block size thus in this case
2819 the padding is calculated only for SILC Packet Header, not for any
2820 other area of the packet.  The same algorithm works in this case as
2821 well, except that the `packet length' is now the SILC Packet Header
2822 length.
2823
2824 The padding MUST be random data, preferably, generated by
2825 cryptographically strong random number generator for each packet
2826 separately.
2827
2828
2829 .ti 0
2830 2.8 Packet Compression
2831
2832 SILC Packets MAY be compressed.  In this case the data payload area
2833 is compressed and all other areas of the packet MUST remain as they
2834 are.  After compression is performed for the data area, the length
2835 field of Packet Header MUST be set to the compressed length of the
2836 data.
2837
2838 The compression MUST always be applied before encryption.  When
2839 the packet is received and decrypted the data area MUST be decompressed.
2840 Note that the true sender of the packet MUST apply the compression and
2841 the true receiver of the packet MUST apply the decompression.  Any
2842 server or router en route SHOULD NOT decompress the packet.
2843
2844
2845 .ti 0
2846 2.9 Packet Sending
2847
2848 The sender of the packet MUST assemble the SILC Packet Header with
2849 correct values.  It MUST set the Source ID of the header as its own
2850 ID, unless it is forwarding the packet.  It MUST also set the Destination
2851 ID of the header to the true destination.  If the destination is client
2852 it will be Client ID, if it is server it will be Server ID and if it is
2853 channel it will be Channel ID.
2854
2855 If the sender wants to compress the packet it MUST apply the
2856 compression now.  Sender MUST also compute the padding as described
2857 in above sections.  Then sender MUST encrypt the packet as has been
2858 described in above sections according whether the packet is normal
2859 packet or special packet.  Then sender MUST compute the MAC of the
2860 packet.  The computed MAC MUST NOT be encrypted.
2861
2862
2863 .ti 0
2864 2.10 Packet Reception
2865
2866 On packet reception the receiver MUST check that all fields in the
2867 SILC Packet Header are valid.  It MUST check the flags of the
2868 header and act accordingly.  It MUST also check the MAC of the packet
2869 and if it is to be failed the packet MUST be discarded.  Also if the
2870 header of the packet includes any bad fields the packet MUST be
2871 discarded.
2872
2873 See above sections on the decryption process of the received packet.
2874
2875 The receiver MUST also check that the ID's in the header are valid
2876 ID's.  Unsupported ID types or malformed ID's MUST cause packet
2877 rejection.  The padding on the reception is always ignored.
2878
2879 The receiver MUST also check the packet type and start parsing the
2880 packet according to the type.  However, note the above sections on
2881 special packet types and their parsing.
2882
2883
2884 .ti 0
2885 2.11 Packet Routing
2886
2887 Routers are the primary entities in the SILC network that takes care
2888 of packet routing.  Normal servers performs packet forwarding, for
2889 example, when they are forwarding channel message to the local clients.
2890 Routing is quite simple as every packet tells the true origin and the
2891 true destination of the packet.
2892
2893 It is still RECOMMENDED for routers that has several routing connections
2894 to create route cache for those destinations that has faster route than
2895 the router's primary route.  This information is available for the router
2896 when other router connects to the router.  The connecting party then
2897 sends all of its locally connected clients, servers and channels.  These
2898 informations helps to create the route cache.  Also, when new channels
2899 are created to a cell its information is broadcasted to all routers
2900 in the network.  Channel ID's are based on router's ID thus it is easy
2901 to create route cache based on these informations.  If faster route for
2902 destination does not exist in router's route cache the packet MUST be
2903 routed to the primary route (default route).
2904
2905 However, there are some issues when routing channel messages to group
2906 of users.  Routers are responsible of routing the channel message to
2907 other routers, local servers and local clients as well.  Routers MUST
2908 send the channel message to only one router in the network, preferably
2909 to the shortest route to reach the channel users.  The message can be
2910 routed into either upstream or downstream.  After the message is sent
2911 to a router in the network it MUST NOT be sent to any other router in
2912 either same route or other route.  The message MUST NOT be routed to
2913 the router it came from.
2914
2915 When routing for example private messages they should be routed to the
2916 shortest route always to reach the destination client as fast as possible.
2917
2918 For server which receives a packet to be forwarded to an entity that is
2919 indirectly connected to the sender, the server MUST check whether that
2920 particular packet type is allowed to be sent to that destination.  Not
2921 all packets may be sent by some odd entity to for example a local client,
2922 or to some remote server or router, that is indirectly connected to the
2923 sender.  See section 2.3 SILC Packet Types and paragraph about indirectly
2924 connected entities and sending packets to them.  That section defines the
2925 packets that may be sent to indirectly connected entities.  When a server
2926 or a router receives a packet that may be sent to indirectly connected
2927 entity and it is destined to other entity except that server, it MUST
2928 route it further either to shortest route or to the primary route to reach
2929 that destination.
2930
2931 Routers form a ring in the SILC network.  However, routers may have other
2932 direct connections to other routers in the network too.  This can cause
2933 interesting routing problems in the network.  Since the network is a ring,
2934 the packets usually should be routed into clock-wise direction, or if it
2935 cannot be used then always counter clock-wise (primary route) direction.
2936 Problems may arise when a faster direct route exists and router is routing
2937 a channel message.  Currently channel messages must be routed either
2938 in upstream or downstream, they cannot be routed to other direct routes.
2939 The SILC protocol should have a shortest path discovery protocol, and some
2940 existing routing protocol, that can handle a ring network with other
2941 direct routes inside the ring (so called hybrid ring-mesh topology),
2942 MAY be defined to be used with the SILC protocol.  Additional
2943 specifications MAY be written on the subject to permeate this
2944 specification.
2945
2946
2947 .ti 0
2948 2.12 Packet Broadcasting
2949
2950 SILC packets MAY be broadcasted in SILC network.  However, only router
2951 server may send or receive broadcast packets.  Client and normal server
2952 MUST NOT send broadcast packets and they MUST ignore broadcast packets
2953 if they receive them.  Broadcast packets are sent by setting Broadcast
2954 flag to the SILC packet header.
2955
2956 Broadcasting packets means that the packet is sent to all routers in
2957 the SILC network, except to the router that sent the packet.  The router
2958 receiving broadcast packet MUST send the packet to its primary route.
2959 The fact that SILC routers may have several router connections can
2960 cause problems, such as race conditions inside the SILC network, if
2961 care is not taken when broadcasting packets.  Router MUST NOT send
2962 the broadcast packet to any other route except to its primary route.
2963
2964 If the primary route of the router is the original sender of the packet
2965 the packet MUST NOT be sent to the primary route.  This may happen
2966 if router has several router connections and some other router uses
2967 the router as its primary route.
2968
2969 Routers use broadcast packets to broadcast for example information
2970 about newly registered clients, servers, channels etc. so that all the
2971 routers may keep these informations up to date.
2972
2973
2974 .ti 0
2975 3 Security Considerations
2976
2977 Security is central to the design of this protocol, and these security
2978 considerations permeate the specification.  Common security considerations
2979 such as keeping private keys truly private and using adequate lengths for
2980 symmetric and asymmetric keys must be followed in order to maintain the
2981 security of this protocol.
2982
2983
2984 .ti 0
2985 4 References
2986
2987 [SILC1]      Riikonen, P., "Secure Internet Live Conferencing (SILC),
2988              Protocol Specification", Internet Draft, January 2007.
2989
2990 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication
2991              Protocols", Internet Draft, January 2007.
2992
2993 [SILC4]      Riikonen, P., "SILC Commands", Internet Draft, January 2007.
2994
2995 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
2996              RFC 1459, May 1993.
2997
2998 [IRC-ARCH]   Kalt, C., "Internet Relay Chat: Architecture", RFC 2810,
2999              April 2000.
3000
3001 [IRC-CHAN]   Kalt, C., "Internet Relay Chat: Channel Management", RFC
3002              2811, April 2000.
3003
3004 [IRC-CLIENT] Kalt, C., "Internet Relay Chat: Client Protocol", RFC
3005              2812, April 2000.
3006
3007 [IRC-SERVER] Kalt, C., "Internet Relay Chat: Server Protocol", RFC
3008              2813, April 2000.
3009
3010 [SSH-TRANS]  Ylonen, T., et al, "SSH Transport Layer Protocol",
3011              Internet Draft.
3012
3013 [PGP]        Callas, J., et al, "OpenPGP Message Format", RFC 2440,
3014              November 1998.
3015
3016 [SPKI]       Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
3017              September 1999.
3018
3019 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key
3020              Infrastructure, Certificate and CRL Profile", RFC 2459,
3021              January 1999.
3022
3023 [Schneier]   Schneier, B., "Applied Cryptography Second Edition",
3024              John Wiley & Sons, New York, NY, 1996.
3025
3026 [Menezes]    Menezes, A., et al, "Handbook of Applied Cryptography",
3027              CRC Press 1997.
3028
3029 [OAKLEY]     Orman, H., "The OAKLEY Key Determination Protocol",
3030              RFC 2412, November 1998.
3031
3032 [ISAKMP]     Maughan D., et al, "Internet Security Association and
3033              Key Management Protocol (ISAKMP)", RFC 2408, November
3034              1998.
3035
3036 [IKE]        Harkins D., and Carrel D., "The Internet Key Exchange
3037              (IKE)", RFC 2409, November 1998.
3038
3039 [HMAC]       Krawczyk, H., "HMAC: Keyed-Hashing for Message
3040              Authentication", RFC 2104, February 1997.
3041
3042 [PKCS1]      Kalinski, B., and Staddon, J., "PKCS #1 RSA Cryptography
3043              Specifications, Version 2.0", RFC 2437, October 1998.
3044
3045 [RFC2119]    Bradner, S., "Key Words for use in RFCs to Indicate
3046              Requirement Levels", BCP 14, RFC 2119, March 1997.
3047
3048 [SFTP]       Ylonen T., and Lehtinen S., "Secure Shell File Transfer
3049              Protocol", Internet Draft, March 2001.
3050
3051 [RFC3629]    Yergeau, F., "UTF-8, a transformation format of ISO
3052              10646", RFC 3629, November 2003.
3053
3054
3055 .ti 0
3056 5 Author's Address
3057
3058 .nf
3059 Pekka Riikonen
3060 Helsinki
3061 Finland
3062
3063 EMail: priikone@iki.fi
3064
3065
3066 .ti 0
3067 6 Full Copyright Statement
3068
3069 Copyright (C) The Internet Society (2007).
3070
3071 This document is subject to the rights, licenses and restrictions
3072 contained in BCP 78, and except as set forth therein, the authors
3073 retain all their rights.
3074
3075 This document and the information contained herein are provided on an
3076 "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS
3077 OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET
3078 ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED,
3079 INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE
3080 INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED
3081 WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE.