typo
[crypto.git] / doc / draft-riikonen-silc-spec-01.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 6 October 2000
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-spec-01.txt                         6 October 2000
20 Expires: 6 Jun 2001
21
22 .in 3
23
24 .ce 3
25 Secure Internet Live Conferencing (SILC),
26 Protocol Specification
27 <draft-riikonen-silc-spec-01.txt>
28
29 .ti 0
30 Status of this Memo
31
32 This document is an Internet-Draft and is in full conformance with   
33 all provisions of Section 10 of RFC 2026.  Internet-Drafts are   
34 working documents of the Internet Engineering Task Force (IETF), its   
35 areas, and its working groups.  Note that other groups may also   
36 distribute working documents as Internet-Drafts.   
37
38 Internet-Drafts are draft documents valid for a maximum of six months   
39 and may be updated, replaced, or obsoleted by other documents at any   
40 time.  It is inappropriate to use Internet-Drafts as reference   
41 material or to cite them other than as "work in progress."   
42
43 The list of current Internet-Drafts can be accessed at   
44 http://www.ietf.org/ietf/1id-abstracts.txt   
45
46 The list of Internet-Draft Shadow Directories can be accessed at   
47 http://www.ietf.org/shadow.html   
48
49 The distribution of this memo is unlimited.  
50
51
52 .ti 0
53 Abstract
54
55 This memo describes a Secure Internet Live Conferencing (SILC)
56 protocol which provides secure conferencing services over insecure
57 network channel.  SILC is IRC [IRC] like protocol, however, it is 
58 not equivalent to IRC and does not support IRC.  Strong cryptographic
59 methods are used to protect SILC packets inside SILC network.  Two
60 other Internet Drafts relates very closely to this memo;  SILC Packet
61 Protocol [SILC2] and SILC Key Exchange and Authentication Protocols
62 [SILC3].
63
64
65
66
67
68
69
70
71 .ti 0
72 Table of Contents
73
74 .nf
75 1 Introduction ..................................................  3
76 2 SILC Concepts .................................................  3
77   2.1 SILC Network Topology .....................................  4
78   2.2 Communication Inside a Cell ...............................  5
79   2.3 Communication in the Network ..............................  6
80   2.4 Channel Communication .....................................  7
81   2.5 Router Connections ........................................  7
82 3 SILC Specification ............................................  8
83   3.1 Client ....................................................  8
84       3.1.1 Client ID ...........................................  9
85   3.2 Server .................................................... 10
86       3.2.1 Server's Local ID List .............................. 10
87       3.2.2 Server ID ........................................... 11 
88       3.2.3 SILC Server Ports ................................... 11
89   3.3 Router .................................................... 12
90       3.3.1 Router's Local ID List .............................. 12
91       3.3.2 Router's Global ID List ............................. 13
92       3.3.3 Router's Server ID .................................. 13
93   3.4 Channels .................................................. 14
94       3.4.1 Channel ID .......................................... 15
95   3.5 Operators ................................................. 15
96   3.6 SILC Commands ............................................. 15
97   3.7 SILC Packets .............................................. 16
98   3.8 Packet Encryption ......................................... 16
99       3.8.1 Determination of the Source and the Destination ..... 17
100       3.8.2 Client To Client .................................... 17
101       3.8.3 Client To Channel ................................... 19
102       3.8.4 Server To Server .................................... 19
103   3.9 Key Exchange And Authentication ........................... 20
104   3.10 Algorithms ............................................... 20
105       3.10.1 Ciphers ............................................ 20
106       3.10.2 Public Key Algorithms .............................. 21
107       3.10.3 MAC Algorithms ..................................... 21
108       3.10.4 Compression Algorithms ............................. 22
109   3.11 SILC Public Key .......................................... 22
110   3.12 SILC Version Detection ................................... 24
111 4 SILC Procedures ............................................... 25
112   4.1 Creating Client Connection ................................ 25
113   4.2 Creating Server Connection ................................ 26
114   4.3 Joining to a Channel ...................................... 27
115   4.4 Channel Key Generation .................................... 28
116   4.5 Private Message Sending and Reception ..................... 29
117   4.6 Private Message Key Generation ............................ 29
118   4.7 Channel Message Sending and Reception ..................... 30
119   4.8 Session Key Regeneration .................................. 30
120   4.9 Command Sending and Reception ............................. 30
121 5 SILC Commands ................................................. 31
122   5.1 SILC Commands Syntax ...................................... 31
123   5.2 SILC Commands List ........................................ 33
124   5.3 SILC Command Status Types ................................. 56
125       5.3.1 SILC Command Status Payload ......................... 56
126       5.3.2 SILC Command Status List ............................ 57
127 6 Security Considerations ....................................... 61
128 7 References .................................................... 61
129 8 Author's Address .............................................. 62
130
131
132 .ti 0
133 List of Figures
134
135 .nf
136 Figure 1:  SILC Network Topology
137 Figure 2:  Communication Inside cell
138 Figure 3:  Communication Between Cells
139 Figure 4:  Router Connections
140 Figure 5:  SILC Public Key
141 Figure 6:  SILC Command Status Payload
142
143
144 .ti 0
145 1. Introduction
146
147 This document describes a Secure Internet Live Conferencing (SILC)
148 protocol which provides secure conferencing services over insecure
149 network channel.  SILC is IRC [IRC] like protocol, however, it is 
150 not equivalent to IRC and does not support IRC.
151
152 Strong cryptographic methods are used to protect SILC packets inside
153 SILC network.  Two other Internet Drafts relates very closely to this
154 memo; SILC Packet Protocol [SILC2] and SILC Key Exchange and
155 Authentication Protocols [SILC3].
156
157 The protocol uses extensively packets as conferencing protocol 
158 requires message and command sending.  The SILC Packet Protocol is
159 described in [SILC2] and should be read to fully comprehend this
160 document and protocol.  [SILC2] also describes the packet encryption
161 and decryption in detail.
162
163 The security of SILC protocol and for any security protocol for that
164 matter is based on strong and secure key exchange protocol.  The SILC
165 Key Exchange protocol is described in [SILC3] along with connection
166 authentication protocol and should be read to fully comprehend this
167 document and protocol.
168
169 The SILC protocol has been developed to work on TCP/IP network
170 protocol, although it could be made to work on other network protocols
171 with only minor changes.  However, it is recommended that TCP/IP
172 protocol is used under SILC protocol.  Typical implementation would
173 be made in client-server model.
174
175
176 .ti 0
177 2. SILC Concepts
178
179 This section describes various SILC protocol concepts that forms the 
180 actual protocol, and in the end, the actual SILC network.  The mission
181 of the protocol is to deliver messages from clients to other clients 
182 through routers and servers in secure manner.  The messages may also 
183 be delivered from one client to many clients forming a group, also 
184 known as a channel.
185
186 This section does not focus to security issues, instead basic network 
187 concepts are introduced to make the topology of the SILC network 
188 clear.
189
190
191 .ti 0
192 2.1 SILC Network Topology
193
194 SILC network is a cellular network as opposed to tree style network 
195 topology.  The rationale for this is to have servers that can perform 
196 specific kind of tasks what other servers cannot perform.  This leads 
197 to two kinds of servers; normal SILC servers and SILC routers.
198
199 A difference between normal server and router server is that routers 
200 knows everything about everything in the network.  They also do the 
201 actual routing of the messages to the correct receiver.  Normal servers 
202 knows only about local information and nothing about global information.
203 This makes the network faster as there are less servers that needs to 
204 keep global information up to date at all time.
205
206 This, on the other hand, leads to cellular like network, where routers 
207 are in the center of the cell and servers are connected to the router.
208
209 Following diagram represents SILC network topology.
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227 .in 8
228 .nf
229   ---- ---- ----         ---- ---- ----
230  | S8 | S5 | S4 |       | S7 | S5 | S6 |
231  ----- ---- -----       ----- ---- -----
232 | S7 | S/R1 | S2 | --- | S8 | S/R2 | S4 |
233  ---- ------ ----       ---- ------ ----
234  | S6 | S3 | S1 |       | S1 | S3 | S2 |         ---- ----
235   ---- ---- ----         ---- ---- ----         | S3 | S1 |
236      Cell 1.   \\             Cell 2.  | \\____  ----- -----
237                 |                     |        | S4 | S/R4 |
238     ---- ---- ----         ---- ---- ----       ---- ------
239    | S7 | S4 | S2 |       | S1 | S3 | S2 |      | S2 | S5 |
240    ----- ---- -----       ----- ---- -----       ---- ----
241   | S6 | S/R3 | S1 | --- | S4 | S/R5 | S5 | ____/ Cell 4.
242    ---- ------ ----       ---- ------ ----
243    | S8 | S5 | S3 |       | S6 | S7 | S8 |     ... etc ...
244     ---- ---- ----         ---- ---- ----
245        Cell 3.                Cell 5.
246 .in 3
247
248 .ce
249 Figure 1:  SILC Network Topology
250
251
252 A cell is formed when a server or servers connect to one router.  In
253 SILC network normal server cannot directly connect to other normal
254 server.  Normal server may only connect to SILC router which then
255 routes the messages to the other servers in the cell.  Router servers
256 on the other hand may connect to other routers to form the actual SILC 
257 network, as seen in above figure.  However, router is also normal SILC 
258 server; clients may connect to it the same way as to normal SILC 
259 servers.  Normal server also cannot have active connections to more 
260 than one router.  Normal server cannot be connected to two different 
261 cells.  Router servers, on the other hand, may have as many router to 
262 router connections as needed.
263
264 There are many issues in this network topology that needs to be careful
265 about.  Issues like the size of the cells, the number of the routers in 
266 the SILC network and the capacity requirements of the routers.  These
267 issues should be discussed in the Internet Community and additional
268 documents on the issue will be written.
269
270
271 .ti 0
272 2.2 Communication Inside a Cell
273
274 It is always guaranteed that inside a cell message is delivered to the 
275 recipient with at most two server hops.  Client who is connected to
276 server in the cell and is talking on channel to other client connected 
277 to other server in the same cell, will have its messages delivered from 
278 its local server first to the router of the cell, and from the router 
279 to the other server in the cell.
280
281 Following diagram represents this scenario:
282
283
284 .in 25
285 .nf
286 1 --- S1     S4 --- 5
287          S/R
288  2 -- S2     S3
289      /        |
290     4         3
291 .in 3
292
293
294 .ce
295 Figure 2:  Communication Inside cell
296
297
298 Example:  Client 1. connected to Server 1. message sent to
299           Client 4. connected to Server 2. travels from Server 1.
300           first to Router which routes the message to Server 2.
301           which then sends it to the Client 4.  All the other
302           servers in the cell will not see the routed message.
303
304
305 If client is connected directly to the router, as router is also normal 
306 SILC server, the messages inside the cell are always delivered only with 
307 one server hop.  If clients communicating with each other are connected 
308 to the same server, no router interaction is needed.  This is the optimal
309 situation of message delivery in the SILC network.
310
311
312 .ti 0
313 2.3 Communication in the Network
314
315 If the message is destined to server that does not belong to local cell 
316 the message is routed to the router server to which the destination 
317 server belongs, if the local router is connected to destination router.
318 If there is no direct connection to the destination router, the local
319 router routes the message to its primary route.  Following diagram
320 represents message sending between cells.
321
322
323 .in 16
324 .nf
325 1 --- S1     S4 --- 5            S2 --- 1
326          S/R - - - - - - - - S/R
327  2 -- S2     S3           S1
328      /        |             \\
329     4         3              2
330
331    Cell 1.               Cell 2.
332 .in 3
333
334
335 .ce
336 Figure 3:  Communication Between Cells
337
338
339 Example:  Client 5. connected to Server 4. in Cell 1. message sent
340           to Client 2. connected to Server 1. in Cell 2. travels
341           from Server 4. to Router which routes the message to
342           Router in Cell 2, which then routes the message to 
343           Server 1.  All the other servers and routers in the
344           network will not see the routed message.
345
346
347 The optimal case of message delivery from client point of view is
348 when clients are connected directly to the routers and the messages
349 are delivered from one router to the other router.
350
351
352 .ti 0 
353 2.4 Channel Communication
354
355 Messages may be sent to group of clients as well.  Sending messages to
356 many clients works the same way as sending messages point to point, from
357 message delivery point of view.  Security issues are another matter
358 which are not discussed in this section.
359
360 Router server handles the message routing to multiple recipients.  If 
361 any recipient is not in the same cell as the sender the messages are 
362 routed further.
363
364 Server distributes the channel message to its local clients who are 
365 joined to the channel.  Also, router distributes the message to its 
366 local clients on the channel.
367
368
369 .ti 0
370 2.5 Router Connections
371
372 Router connections play very important role in making the SILC like
373 network topology to work.  For example, sending broadcast packets in
374 SILC network require special connections between routers; routers must
375 be connected in specific way.
376
377 Every router has their primary route which is a connection to another
378 router in the network.  Unless there is only two routers in the network
379 must not routers use each other as their primary routes.  The router
380 connections in the network must form a circular.
381
382 Example with three routers in the network:
383
384
385
386
387
388
389
390 .in 16
391 .nf
392     S/R1 - > - > - > - > - > - > - S/R2
393      \\                               /
394       ^                             v
395        \\ - < -  < - S/R3 - < - < - /
396 .in 3
397
398
399 .ce
400 Figure 4:  Router Connections
401
402
403 Example:  Network with three routers.  Router 1. uses Router 2. as its
404           primary router.  Router 2. uses Router 3. as its primary router,
405           and Router 3. uses Router 1. as its primary router.  There may
406           be other direct connections between the routers but they must
407           not be used as primary routes.
408
409 The above example is applicable to any amount of routers in the network
410 except for two routers.  If there are only two routers in the network both
411 routers must be able to handle situation where they use each other as their
412 primary routes.
413
414 The issue of router connections are very important especially with SILC
415 broadcast packets.  Usually all router wide information in the network is
416 distributed by SILC broadcast packets.
417
418
419 .ti 0
420 3. SILC Specification
421
422 This section describes the SILC protocol.  However, [SILC2] and
423 [SILC3] describes other important protocols that are part of this SILC
424 specification and must be read.
425
426
427 .ti 0
428 3.1 Client
429
430 A client is a piece of software connecting to SILC server.  SILC client 
431 cannot be SILC server.  Purpose of clients is to provide the user 
432 interface of the SILC services for end user.  Clients are distinguished
433 from other clients by unique Client ID.  Client ID is a 128 bit ID that
434 is used in the communication in the SILC network.  The client ID is 
435 based on the nickname selected by the user.  User uses logical nicknames
436 in communication which are then mapped to the corresponding Client ID.
437 Client ID's are low level identifications and must not be seen by the
438 end user.
439
440 Clients provide other information about the end user as well. Information
441 such as the nickname of the user, username and the hostname of the end 
442 user and user's real name.  See section 3.2 Server for information of 
443 the requirements of keeping this information.
444
445 The nickname selected by the user is not unique in the SILC network.
446 There can be 2^8 same nicknames for one IP address. As for comparison to
447 IRC [IRC] where nicknames are unique this is a fundamental difference
448 between SILC and IRC.  This causes the server names to be used along
449 with the nicknames to identify specific users when sending messages.
450 This feature of SILC makes IRC style nickname-wars obsolete as no one
451 owns their nickname; there can always be someone else with the same
452 nickname.  Another difference is that there are no limit of the length
453 of the nickname in the SILC.
454
455
456 .ti 0
457 3.1.1 Client ID
458
459 Client ID is used to identify users in the SILC network.  The Client ID
460 is unique to the extent that there can be 2^128 different Client ID's.
461 Collisions are not expected to happen.  The Client ID is defined as 
462 follows.
463
464 .in 6
465 128 bit Client ID based on IPv4 addresses:
466
467 32 bit  ServerID IP address (bits 1-32)
468  8 bit  Random number
469 88 bit  Truncated MD5 hash value of the nickname
470
471 o Server ID IP address - Indicates the server where this
472   client is coming from.  The IP address hence equals the
473   server IP address where to the client has connected.
474
475 o Random number - Random number to further randomize the
476   Client ID.  This makes it possible to have 2^8 same
477   nicknames from the same server IP address.
478
479 o MD5 hash - MD5 hash value of the nickname is truncated
480   taking 88 bits from the start of the hash value.  This
481   hash value is used to search the user's Client ID from
482   the ID lists.
483
484 .in 3
485 Collisions could occur when more than 2^8 clients using same nickname
486 from the same server IP address is connected to the SILC network.  
487 Server must be able to handle this situation by refusing to accept 
488 anymore of that nickname.
489
490 Another possible collision may happen with the truncated hash value of
491 the nickname.  It could be possible to have same truncated hash value for
492 two different nicknames.  However, this is not expected to happen nor
493 cause any problems if it would occur.  Nicknames are usually logical and
494 it is unlikely to have two distinct logical nicknames produce same
495 truncated hash value.
496
497
498 .ti 0
499 3.2 Server
500
501 Servers are the most important parts of the SILC network.  They form the
502 basis of the SILC, providing a point to which clients may connect to.
503 There are two kinds of servers in SILC; normal servers and router servers.
504 This section focus on the normal server and router server is described
505 in the section 3.3 Router.
506
507 Normal servers may not directly connect to other normal server.  Normal
508 servers may only directly connect to router server.  If the message sent
509 by the client is destined outside the local server it is always sent to
510 the router server for further routing.  Server may only have one active
511 connection to router on same port.  Normal server may not connect to other
512 cell's router except in situations where its cell's router is unavailable.
513
514 Servers and routers in the SILC network are considered to be trusted.
515 With out a doubt, servers that are set to work on ports above 1023 are
516 not considered to be trusted.  Also, the service provider acts important
517 role in the server's trustworthy.
518
519
520 .ti 0
521 3.2.1 Server's Local ID List
522
523 Normal server keeps various information about the clients and their end
524 users connected to it.  Every normal server must keep list of all locally
525 connected clients, Client ID's, nicknames, usernames and hostnames and
526 user's real name.  Normal servers only keeps local information and it
527 does not keep any global information.  Hence, normal servers knows only
528 about their locally connected clients.  This makes servers efficient as
529 they don't have to worry about global clients.  Server is also responsible
530 of creating the Client ID's for their clients.
531
532 Normal server also keeps information about locally created channels and
533 their Channel ID's.
534
535
536 Hence, local list for normal server includes:
537
538 .in 6
539 server list        - Router connection
540    o Server name
541    o Server IP address
542    o Server ID
543    o Sending key
544    o Receiving key
545    o Public key
546
547
548
549
550 client list        - All clients in server
551    o Nickname
552    o Username@host
553    o Real name
554    o Client ID
555    o Sending key
556    o Receiving key
557
558 channel list       - All channels in server
559    o Channel name
560    o Channel ID
561    o Client ID's on channel
562    o Client ID modes on channel
563    o Channel key
564 .in 3
565
566
567
568 .ti 0
569 3.2.2 Server ID
570
571 Servers are distinguished from other servers by unique 64 bit Server ID.
572 The Server ID is used in the SILC to route messages to correct servers.
573 Server ID's also provide information for Client ID's, see section 3.1.1
574 Client ID.  Server ID is defined as follows.
575
576 .in 6
577 64 bit Server ID based on IPv4 addresses:
578
579 32 bit  IP address of the server
580 16 bit  Port
581 16 bit  Random number
582
583 o IP address of the server - This is the real IP address of
584   the server.
585
586 o Port - This is the port the server is bound to.
587
588 o Random number - This is used to further randomize the Server ID.
589
590 .in 3
591 Collisions are not expected to happen in any conditions.  The Server ID
592 is always created by the server itself and server is responsible of
593 distributing it to the router.
594
595
596 .ti 0
597 3.2.3 SILC Server Ports
598
599 Following ports has been assigned by IANA for the SILC protocol:
600
601 .in 10
602 silc            706/tcp    SILC
603 silc            706/udp    SILC
604 .in 3
605
606 If there are needs to create new SILC networks in the future the port
607 numbers must be officially assigned by the IANA.
608
609 Server on network above privileged ports (>1023) should not be trusted
610 as they could have been set up by untrusted party.
611
612
613 .ti 0
614 3.3 Router
615
616 Router server in SILC network is responsible for keeping the cell together
617 and routing messages to other servers and to other routers.  Router server
618 is also a normal server thus clients may connect to it as it would be
619 just normal SILC server.
620
621 However, router servers has a lot of important tasks that normal servers
622 do not have.  Router server knows everything about everything in the SILC.
623 They know all clients currently on SILC, all servers and routers and all
624 channels in SILC.  Routers are the only servers in SILC that care about
625 global information and keeping them up to date at all time.  And, this
626 is what they must do.
627
628
629 .ti 0
630 3.3.1 Router's Local ID List
631
632 Router server as well must keep local list of connected clients and
633 locally created channels.  However, this list is extended to include all
634 the informations of the entire cell, not just the server itself as for
635 normal servers.
636
637 However, on router this list is a lot smaller since routers do not keep
638 information about user's nickname, username and hostname and real name
639 since these are not needed by the router.  Router keeps only information
640 that it needs.
641
642
643 Hence, local list for router includes:
644
645 .in 6
646 server list        - All servers in the cell
647    o Server name
648    o Server ID
649    o Router's Server ID
650    o Sending key
651    o Receiving key
652
653 client list        - All clients in the cell
654    o Client ID
655
656
657 channel list       - All channels in the cell
658    o Channel ID
659    o Client ID's on channel
660    o Client ID modes on channel
661    o Channel key
662 .in 3
663
664
665 Note that locally connected clients and other information include all the
666 same information as defined in section section 3.2.1 Server's Local ID
667 List.
668
669
670 .ti 0
671 3.3.2 Router's Global ID List
672
673 Router server must also keep global list.  Normal servers do not have
674 global list as they know only about local information.  Global list
675 includes all the clients on SILC, their Client ID's, all created channels
676 and their Channel ID's and all servers and routers on SILC and their
677 Server ID's.  That is said, global list is for global information and the
678 list must not include the local information already on the router's local
679 list.
680
681 Note that the global list does not include information like nicknames,
682 usernames and hostnames or user's real names.  Router does not keep
683 these informations as they are not needed by the router.  This 
684 information is available from the client's server which maybe queried
685 when needed.
686
687 Hence, global list includes:
688
689 .in 6
690 server list        - All servers in SILC
691    o Server name
692    o Server ID
693    o Router's Server ID
694
695
696 client list        - All clients in SILC
697    o Client ID
698
699 channel list       - All channels in SILC
700    o Channel ID
701    o Client ID's on channel
702    o Client ID modes on channel
703 .in 3
704
705
706 .ti 0
707 3.3.3 Router's Server ID
708
709 Router's Server ID's are equivalent to normal Server ID's.  As routers
710 are normal servers as well same types of ID's applies for routers as well.
711 Thus, see section 3.2.2 Server ID.  Server ID's for routers are always
712 created by the remote router where the router is connected to.
713
714
715 .ti 0
716 3.4 Channels
717
718 A channel is a named group of one or more clients which will all receive
719 messages addressed to that channel.  The channel is created when first
720 client requests JOIN command to the channel, and the channel ceases to
721 exist when the last client has left it.  When channel exists, any client
722 can reference it using the name of the channel.
723
724 Channel names are unique although the real uniqueness comes from 64 bit
725 Channel ID that unifies each channel.  However, channel names are still
726 unique and no two global channels with same name may exist.  Channel name
727 is a string which begins with `#' character.  There is no limit on the
728 length of the channel name.  Channel names may not contain any spaces
729 (`  '), any non-printable ASCII characters, commas (`,') and wildcard
730 characters.
731
732 Channels can have operators that can administrate the channel and
733 operate all of its modes.  Following operators on channel exist on SILC
734 network.
735
736 .in 6
737 o Channel founder - When channel is created the joining client becomes
738   channel founder.  Channel founder is channel operator with some more
739   privileges.  Basically, channel founder can fully operate the channel
740   and all of its modes.  The privileges are limited only to the particular
741   channel.  There can be only one channel founder per channel.  Channel
742   founder supersedes channel operator's privileges.
743
744   Channel founder privileges cannot be removed by any other operator on
745   channel.  When channel founder leaves the channel there is no channel
746   founder on the channel.  Channel founder also cannot be removed by
747   force from the channel.
748
749 o Channel operator - When client joins to channel that has not existed
750   previously it will become automatically channel operator (and channel
751   founder discussed above).  Channel operator is able administrate the
752   channel, set some modes on channel, remove a badly behaving client from
753   the channel and promote other clients to become channel operator.
754   The privileges are limited only to the particular channel.
755
756   Normal channel user may be promoted (opped) to channel operator
757   gaining channel operator privileges.  Channel founder or other channel
758   operator may also demote (deop) channel operator to normal channel
759   user.
760 .in 3
761
762
763 .ti 0
764 3.4.1 Channel ID
765
766 Channels are distinguished from other channels by unique Channel ID.
767 The Channel ID is a 64 bit ID and collisions are not expected to happen
768 in any conditions.  Channel names are just for logical use of channels.
769 The Channel ID is created by the server where the channel is created.
770 The Channel ID is defined as follows.
771
772 .in 6
773 64 bit Channel ID based on IPv4 addresses:
774
775 32 bit  Router's Server ID IP address (bits 1-32)
776 16 bit  Router's Server ID port (bits 33-48)
777 16 bit  Random number
778
779 o Router's Server ID IP address - Indicates the IP address of 
780   the router of the cell where this channel is created.  This is 
781   taken from the router's Server ID.  This way SILC router knows 
782   where this channel resides in the SILC network.
783
784 o Router's Server ID port - Indicates the port of the channel on 
785   the server.  This is taken from the router's Server ID.
786
787 o Random number - To further randomize the Channel ID.  This makes
788   sure that there are no collisions.  This also means that
789   in a cell there can be 2^16 channels.
790 .in 3
791
792
793 .ti 0
794 3.5 Operators
795
796 Operators are normal users with extra privileges to their server or
797 router.  Usually these people are SILC server and router administrators
798 that take care of their own server and clients on them.  The purpose of
799 operators is to administrate the SILC server or router.  However, even
800 an operator with highest privileges is not able to enter invite-only
801 channel, to gain access to the contents of a encrypted and authenticated
802 packets traveling in the SILC network or to gain channel operator
803 privileges on public channels without being promoted.  They have the
804 same privileges as everyone else except they are able to administrate
805 their server or router.
806
807
808 .ti 0
809 3.6 SILC Commands
810
811 Commands are very important part on SILC network especially for client
812 which uses commands to operate on the SILC network.  Commands are used
813 to set nickname, join to channel, change modes and many other things.
814
815 Client usually sends the commands and server replies by sending a reply
816 packet to the command.  Server may also send commands usually to serve
817 the original client's request.  However, server may not send command
818 to client and there are some commands that server must not send.  Server
819 is also able to send the forwarded command packets.  For example, 
820 SILC_COMMAND_JOIN is always forwarded packet.  See [SILC2] for more
821 about packet forwarding.
822
823 Note that the command reply is usually sent only after client has sent
824 the command request but server is allowed to send command reply packet
825 to client even if client has not requested the command.  Client may,
826 however, choose not to accept the command reply, but there are some
827 command replies that the client should accept.  Example of a such
828 command reply is reply to SILC_COMMAND_CMODE command that the server
829 uses to distribute the channel mode on all clients on the channel
830 when the mode has changed.
831
832 It is expected that some of the commands may be miss-used by clients
833 resulting various problems on the server side.  Every implementation
834 should assure that commands may not be executed more than once, say,
835 in two (2) seconds.  This should be sufficient to prevent the miss-use
836 of commands.
837
838 SILC commands are described in section 5 SILC Commands.
839
840
841 .ti 0
842 3.7 SILC Packets
843
844 Packets are naturally the most important part of the protocol and the
845 packets are what actually makes the protocol.  Packets in SILC network
846 are always encrypted using, usually, the shared secret session key
847 or some other key, for example, channel key, when encrypting channel
848 messages.  The SILC Packet Protocol is a wide protocol and is described
849 in [SILC2].  This document does not define or describe details of
850 SILC packets.
851
852
853
854 .ti 0
855 3.8 Packet Encryption
856
857 All packets passed in SILC network must be encrypted.  This section
858 defines how packets must be encrypted in the SILC network.  The detailed
859 description of the actual encryption process of the packets are
860 described in [SILC2].
861
862 Client and its server shares secret symmetric session key which is
863 established by the SILC Key Exchange Protocol, described in [SILC3]. 
864 Every packet sent from client to server, with exception of packets for
865 channels, are encrypted with this session key.
866
867 Channels has their own key that are shared by every client on the channel.
868 However, the channel keys are cell specific thus one cell does not know
869 the channel key of the other cell, even if that key is for same channel.
870 Channel key is also known by the routers and all servers that has clients
871 on the channel.  However, channels may have channel private keys that
872 are entirely local setting for client.  All clients on the channel must
873 know the channel private key before hand to be able to talk on the
874 channel.  In this case, no server or router knows the key for channel.
875
876 Server shares secret symmetric session key with router which is
877 established by the SILC Key Exchange Protocol.  Every packet passed from
878 server to router, with exception of packets for channels, are encrypted
879 with the shared session key.  Same way, router server shares secret
880 symmetric key with its primary route.  However, every packet passed
881 from router to other router, including packets for channels, are
882 encrypted with the shared session key.  Every router connection has
883 their own session keys.
884
885
886 .ti 0
887 3.8.1 Determination of the Source and the Destination
888
889 The source and the destination of the packet needs to be determined
890 to be able to route the packets to correct receiver.  This information
891 is available in the SILC Packet Header which is included in all packets
892 sent in SILC network.  The SILC Packet Header is described in [SILC2].
893
894 The header is always encrypted with the session key who is next receiver
895 of the packet along the route.  The receiver of the packet, for example
896 a router along the route, is able to determine the sender and the
897 destination of the packet by decrypting the SILC Packet Header and
898 checking the ID's attached to the header.  The ID's in the header will
899 tell to where the packet needs to be sent and where it is coming from.
900
901 The header in the packet does not change during the routing of the
902 packet.  The original sender, for example client, assembles the packet
903 and the packet header and server or router between the sender and the
904 receiver must not change the packet header.
905
906 Note that the packet and the packet header may be encrypted with
907 different keys.  For example, packets to channels are encrypted with
908 the channel key, however, the header is encrypted with the session key
909 as described above.  However, the header and the packet may be encrypted
910 with same key.  This is case, for example, with command packets.
911
912
913 .ti 0
914 3.8.2 Client To Client
915
916 Process of message delivery and encryption from client to another
917 client is as follows.
918
919 Example:  Private message from client to another client on different
920           servers.  Clients do not share private message delivery
921           keys; normal session keys are used.
922
923 o Client 1. sends encrypted packet to its server.  The packet is
924   encrypted with the session key shared between client and its
925   server.
926
927 o Server determines the destination of the packet and decrypts
928   the packet.  Server encrypts the packet with session key shared
929   between the server and its router, and sends the packet to the
930   router.
931
932 o Router determines the destination of the packet and decrypts
933   the packet.  Router encrypts the packet with session key 
934   shared between the router and the destination server, and sends
935   the packet to the server.
936
937 o Server determines the client to which the packet is destined
938   to and decrypts the packet.  Server encrypts the packet with
939   session key shared between the server and the destination client,
940   and sends the packet to the client.
941
942 o Client 2. decrypts the packet.
943
944
945 Example:  Private message from client to another client on different
946           servers.  Clients has established secret shared private
947           message delivery key with each other and that is used in 
948           the message encryption.
949
950 o Client 1. sends encrypted packet to its server.  The packet is
951   encrypted with the private message delivery key shared between
952   clients.
953
954 o Server determines the destination of the packet and sends the 
955   packet to the router.
956
957 o Router determines the destination of the packet and sends the
958   packet to the server.
959
960 o Server determines the client to which the packet is destined
961   to and sends the packet to the client.
962
963 o Client 2. decrypts the packet with the secret shared key.
964
965
966 If clients share secret key with each other the private message
967 delivery is much simpler since servers and routers between the
968 clients do not need to decrypt and re-encrypt the packet.
969
970 The process for clients on same server is much simpler as there are
971 no need to send the packet to the router.  The process for clients 
972 on different cells is same as above except that the packet is routed 
973 outside the cell.  The router of the destination cell routes the 
974 packet to the destination same way as described above.
975
976
977 .ti 0
978 3.8.3 Client To Channel
979
980 Process of message delivery from client on channel to all the clients
981 on the channel.
982
983 Example:  Channel of four users; two on same server, other two on
984           different cells.  Client sends message to the channel.
985
986 o Client 1. encrypts the packet with channel key and sends the
987   packet to its server.
988
989 o Server determines local clients on the channel and sends the
990   packet to the Client on the same server.  Server then sends
991   the packet to its router for further routing.
992
993 o Router determines local clients on the channel, if found
994   sends packet to the local clients.  Router determines global
995   clients on the channel and sends the packet to its primary
996   router or fastest route.
997
998 o (Other router(s) do the same thing and sends the packet to
999    the server(s))
1000
1001 o Server determines local clients on the channel and sends the
1002   packet to the client.
1003
1004 o All clients receiving the packet decrypts the packet.
1005
1006
1007 .ti 0
1008 3.8.4 Server To Server
1009
1010 Server to server packet delivery and encryption is described in above
1011 examples. Router to router packet delivery is analogous to server to
1012 server.  However, some packets, such as channel packets, are processed
1013 differently.  These cases are described later in this document and
1014 more in detail in [SILC2].
1015
1016
1017 .ti 0
1018 3.9 Key Exchange And Authentication
1019
1020 Key exchange is done always when for example client connects to server
1021 but also when server and router and router and router connects to each
1022 other.  The purpose of key exchange protocol is to provide secure key
1023 material to be used in the communication.  The key material is used to
1024 derive various security parameters used to secure SILC packets.  The
1025 SILC Key Exchange protocol is described in detail in [SILC3].
1026
1027 Authentication is done after key exchange protocol has been successfully
1028 completed.  The purpose of authentication is to authenticate for example
1029 client connecting to the server.  However, Usually clients are accepted
1030 to connect to server without explicit authentication.  Servers are
1031 required use authentication protocol when connecting.  The authentication
1032 may be based on passphrase (pre-shared-secret) or public key.  The
1033 connection authentication protocol is described in detail in [SILC3].
1034
1035
1036 .ti 0
1037 3.10 Algorithms
1038
1039 This section defines all the allowed algorithms that can be used in
1040 the SILC protocol.  This includes mandatory cipher, mandatory public
1041 key algorithm and MAC algorithms.
1042
1043
1044 .ti 0
1045 3.10.1 Ciphers
1046
1047 Cipher is the encryption algorithm that is used to protect the data
1048 in the SILC packets.  See [SILC2] of the actual encryption process and
1049 definition of how it must be done.  SILC has a mandatory algorithm that
1050 must be supported in order to be compliant with this protocol.
1051
1052 Following ciphers are defined in SILC protocol:
1053
1054 .in 6
1055 aes-cbc         AES in CBC mode       (mandatory)
1056 twofish-cbc     Twofish in CBC mode   (optional)
1057 blowfish-cbc    Blowfish in CBC mode  (optional)
1058 rc6-cbc         RC6 in CBC mode       (optional)
1059 rc5-cbc         RC5 in CBC mode       (optional)
1060 mars-cbc        Mars in CBC mode      (optional)
1061 none            No encryption         (optional)
1062 .in 3
1063
1064
1065 All algorithms must use minimum of 128 bit key, by default.  Several
1066 algorithms, however, supports longer keys and it is recommended to use
1067 longer keys if they are available.
1068
1069 Algorithm none does not perform any encryption process at all and 
1070 thus is not recommended to be used.  It is recommended that no client
1071 or server implementation would accept none algorithms except in special
1072 debugging mode.
1073
1074 Additional ciphers may be defined to be used in SILC by using the
1075 same name format as above.
1076
1077
1078 .ti 0
1079 3.10.2 Public Key Algorithms
1080
1081 Public keys are used in SILC to authenticate entities in SILC network
1082 and to perform other tasks related to public key cryptography.  The 
1083 public keys are also used in the SILC Key Exchange protocol [SILC3].
1084
1085 Following public key algorithms are defined in SILC protocol:
1086
1087 .in 6
1088 rsa        RSA  (mandatory)
1089 dss        DSS  (optional)
1090 .in 3
1091
1092 Both of the algorithms are described in [Scheneir] and [Menezes].
1093
1094 Additional public key algorithms may be defined to be used in SILC.
1095
1096
1097 .ti 0
1098 3.10.3 MAC Algorithms
1099
1100 Data integrity is protected by computing a message authentication code
1101 (MAC) of the packet data.  See [SILC2] for details how to compute the
1102 MAC.
1103
1104 Following MAC algorithms are defined in SILC protocol:
1105
1106 .in 6
1107 hmac-sha1        HMAC-SHA1, length = 20  (mandatory)
1108 hmac-md5         HMAC-MD5, length = 16   (optional)
1109 none             No MAC                  (optional)
1110 .in 3
1111
1112 The none MAC is not recommended to be used as the packet is not
1113 authenticated when MAC is not computed.  It is recommended that no
1114 client or server would accept none MAC except in special debugging
1115 mode.
1116
1117 The HMAC algorithm is described in [HMAC] and hash algorithms that
1118 are used as part of the HMACs are described in [Scheneir] and in
1119 [Menezes]
1120
1121 Additional MAC algorithms may be defined to be used in SILC.
1122
1123
1124 .ti 0
1125 3.10.4 Compression Algorithms
1126
1127 SILC protocol supports compression that may be applied to unencrypted
1128 data.  It is recommended to use compression on slow links as it may
1129 significantly speed up the data transmission.  By default, SILC does not
1130 use compression which is the mode that must be supported by all SILC
1131 implementations.
1132
1133 Following compression algorithms are defined:
1134
1135 .in 6
1136 none        No compression               (mandatory)
1137 zlib        GBU ZLIB (LZ77) compression  (optional)
1138 .in 3
1139
1140 Additional compression algorithms may be defined to be used in SILC.
1141
1142
1143 .ti 0
1144 3.11 SILC Public Key
1145
1146 This section defines the type and format of the SILC public key.  All
1147 implementations must support this public key type.  See [SILC3] for
1148 other optional public key and certificate types allowed in SILC
1149 protocol.  Public keys in SILC may be used to authenticate entities
1150 and to perform other tasks related to public key cryptography.
1151
1152 The format of the SILC Public Key is as follows:
1153
1154
1155 .in 5
1156 .nf
1157                      1                   2                   3
1158  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
1159 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1160 |                        Public Key Length                      |
1161 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1162 |     Algorithm Name Length     |                               |
1163 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1164 |                                                               |
1165 ~                         Algorithm Name                        ~
1166 |                                                               |
1167 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1168 |       Identifier Length       |                               |
1169 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                               +
1170 |                                                               |
1171 ~                           Identifier                          ~
1172 |                                                               |
1173 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1174 |                                                               |
1175 ~                           Public Data                         ~
1176 |                                                               |
1177 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
1178 .in 3
1179
1180 .ce
1181 Figure 5:  SILC Public Key
1182
1183
1184 .in 6
1185 o Public Key Length (4 bytes) - Indicates the full length
1186   of the public key, not including this field.
1187
1188 o Algorithm Name Length (2 bytes) - Indicates the length
1189   of the Algorithm Length field, not including this field.
1190
1191 o Algorithm name (variable length) - Indicates the name
1192   of the public key algorithm that the key is.  See the
1193   section 3.10.2 Public Key Algorithms for defined names.
1194
1195 o Identifier Length (2 bytes) - Indicates the length of
1196   the Identifier field, not including this field.
1197
1198 o Identifier (variable length) - Indicates the identifier
1199   of the public key.  This data can be used to identify
1200   the owner of the key.  The identifier is of following
1201   format:
1202
1203      UN   User name
1204      HN   Host name or IP address
1205      RN   Real name
1206      E    EMail address
1207      O    Organization
1208      C    Country
1209
1210
1211   Examples of an identifier:
1212
1213     `UN=priikone, HN=poseidon.pspt.fi, E=priikone@poseidon.pspt.fi'
1214
1215     `UN=sam, HN=dummy.fi, RN=Sammy Sam, O=Company XYZ, C=Finland'
1216
1217   At least user name (UN) and host name (HN) must be provided as
1218   identifier.  The fields are separated by commas (`,').  If
1219   comma is in the identifier string it must be written as `\\,',
1220   for example, `O=Company XYZ\\, Inc.'.
1221
1222 o Public Data (variable length) - Includes the actual
1223   public data of the public key.
1224
1225   The format of this field for RSA algorithm is
1226   as follows:
1227
1228      4 bytes            Length of e
1229      variable length    e
1230      4 bytes            Length of n
1231      variable length    n
1232
1233
1234   The format of this field for DSS algorithm is
1235   as follows:
1236
1237      4 bytes            Length of p
1238      variable length    p
1239      4 bytes            Length of q
1240      variable length    q
1241      4 bytes            Length of g
1242      variable length    g
1243      4 bytes            Length of y
1244      variable length    y
1245
1246   The variable length fields are multiple precession
1247   integers encoded as strings in both examples.
1248
1249   Other algorithms must define their own type of this
1250   field if they are used.
1251 .in 3
1252
1253 All fields in the public key are in MSB (most significant byte first)
1254 order.
1255
1256
1257 .ti 0
1258 3.12 SILC Version Detection
1259
1260 The version detection of both client and server is performed at the
1261 connection phase while executing the SILC Key Exchange protocol.  The
1262 version identifier is exchanged between initiator and responder.  The
1263 version identifier is of following format:
1264
1265 .in 6
1266 SILC-<protocol version>-<software version>
1267 .in 3
1268
1269 The version strings are of following format:
1270
1271 .in 6
1272 protocol version = <major>.<minor>
1273 software version = <major>[.<minor>[.<build>]]
1274 .in 3
1275
1276 Protocol version may provide both major and minor version.  Currently
1277 implementations must set the protocol version and accept the protocol
1278 version as SILC-1.0-<sotware version>. 
1279
1280 Software version may provide major, minor and build version.  The
1281 software version may be freely set and accepted.
1282
1283
1284 Thus, the version string could be, for example:
1285
1286 .in 6
1287 SILC-1.0-1.2
1288 .in 3
1289
1290
1291 .ti 0
1292 4 SILC Procedures
1293
1294 This section describes various SILC procedures such as how the 
1295 connections are created and registered, how channels are created and
1296 so on.  The section describes the procedures only generally as details
1297 are described in [SILC2] and [SILC3].
1298
1299
1300 .ti 0
1301 4.1 Creating Client Connection
1302
1303 This section describes the procedure when client connects to SILC server.
1304 When client connects to server the server must perform IP address lookup
1305 and reverse IP address lookup to assure that the origin host really is
1306 who it claims to be.  Client, host, connecting to server must have 
1307 both valid IP address and fully qualified domain name (FQDN).
1308
1309 After that client and server performs SILC Key Exchange protocol which
1310 will provide the key material used later in the communication.  The
1311 key exchange protocol must be completed successfully before the connection
1312 registration may continue.  The SILC Key Exchange protocol is described
1313 in [SILC3].
1314
1315 Typical server implementation would keep a list of connections that it
1316 allows to connect to the server.  The implementation would check, for
1317 example, the connecting client's IP address from the connection list
1318 before the SILC Key Exchange protocol has been started.  Reason for
1319 this is that if the host is not allowed to connect to the server there
1320 is no reason to perform a key exchange protocol.
1321
1322 After successful key exchange protocol the client and server performs
1323 connection authentication protocol.  The purpose of the protocol is to
1324 authenticate the client connecting to the server.  Flexible
1325 implementation could also accept the client to connect to the server
1326 without explicit authentication.  However, if authentication is
1327 desired for a specific client it may be based on passphrase or
1328 public key authentication.  If authentication fails the connection
1329 must be terminated.  The connection authentication protocol is described
1330 in [SILC3].
1331
1332 After successful key exchange and authentication protocol the client
1333 registers itself by sending SILC_PACKET_NEW_CLIENT packet to the
1334 server.  This packet includes various information about the client
1335 that the server uses to create the client.  Server creates the client
1336 and sends SILC_PACKET_NEW_ID to the client which includes the created
1337 Client ID that the client must start using after that.  After that
1338 all SILC packets from the client must have the Client ID as the
1339 Source ID in the SILC Packet Header, described in [SILC2].
1340
1341 Client must also get the server's Server ID that is to be used as
1342 Destination ID in the SILC Packet Header when communicating with
1343 the server (for example when sending commands to the server).  The
1344 ID may be resolved in two ways.  Client can take the ID from an
1345 previously received packet from server that must include the ID,
1346 or to send SILC_COMMAND_INFO command and receive the Server ID as
1347 command reply.
1348
1349 Server may choose not to use the information received in the
1350 SILC_PACKET_NEW_CLIENT packet.  For example, if public key or 
1351 certificate were used in the authentication, server may use those
1352 informations rather than what it received from client.  This is suitable
1353 way to get the true information about client if it is available.
1354
1355 The nickname of client is initially set to the username sent in the
1356 SILC_PACKET_NEW_CLIENT packet.  User should set the nickname to more
1357 suitable by sending SILC_COMMAND_NICK command.  However, this is not
1358 required as part of registration process.
1359
1360 Server must also distribute the information about newly registered
1361 client to its router (or if the server is router, to all routers in
1362 the SILC network).  More information about this in [SILC2].
1363
1364
1365 .ti 0
1366 4.2 Creating Server Connection
1367
1368 This section descibres the procedure when server connects to its
1369 router (or when router connects to other router, the cases are
1370 equivalent).  The procedure is very much alike when client connects
1371 to the server thus it is not repeated here.
1372
1373 One difference is that server must perform connection authentication
1374 protocol with proper authentication.  Proper authentication is based
1375 on passphrase or public key authentication.
1376
1377 After server and router has successfully performed the key exchange
1378 and connection authentication protocol, the server register itself
1379 to the router by sending SILC_PACKET_NEW_SERVER packet.  This packet
1380 includes the server's Server ID that it has created by itself and
1381 other relevant information about the server.
1382
1383 After router has received the SILC_PACKET_NEW_SERVER packet it
1384 distributes the information about newly registered server to all routers
1385 in the SILC network.  More information about this in [SILC2].
1386
1387 As client needed to resolve the destination ID this must be done by the
1388 server that connected to the router, as well.  The way to resolve it is
1389 to get the ID from previously received packet.  Server must also start
1390 using its own Server ID as Source ID in SILC Packet Header and the
1391 router's Server ID as Destination when communicating with the router.
1392
1393 If the server has already connected clients and locally created
1394 channels the server must distribute these informations to the router.
1395 The distribution is done by sending packet SILC_PACKET_NEW_CHANNEL.
1396 See [SILC2] for more information on this.
1397
1398
1399 .ti 0
1400 4.3 Joining to a Channel
1401
1402 This section describes the procedure when client joins to a channel.
1403 Client may join to channel by sending command SILC_COMMAND_JOIN to the
1404 server.  If the receiver receiving join command is normal server the
1405 server must check its local list whether this channel already exists
1406 locally.  This would indicate that some client connected to the server
1407 has already joined to the channel.  If this is case the client is
1408 joined to the client, new channel key is created and information about
1409 newly joined channel is sent to the router.  The new channel key is
1410 also distributed to the router and to all clients on the channel.
1411
1412 If the channel does not exist in the local list the command must be
1413 forwarded to the router which will then perform the actual joining
1414 procedure.  When server receives the reply to the command from the
1415 router it must be distributed to the client who sent the command
1416 originally.  Server will also receive the channel key from the server
1417 that it must distribute to the client who originally requested the
1418 join command.  The server must also save the channel key.
1419
1420 If the receiver of the join command is router it must first check its
1421 local list whether anyone in the cell has already joined to the channel.
1422 If this is the case the client is joined to the channel and reply is
1423 sent to the client.  If the command was sent by server the command reply
1424 is sent to the server who sent it.  Then the router must also create
1425 new channel key and distribute it to all clients on the channel and
1426 all servers that has clients on the channel.
1427
1428 If the channel does not exist on the router's local list it must
1429 check the global list whether the channel exists at all.  If it does
1430 the client is joined to the channel as described previously.  If
1431 the channel does not exist the channel is created and the client
1432 is joined to the channel.  The channel key is also created and
1433 distributed as previously described.  The client joining to the created
1434 channel is made automatically channel founder and both channel founder
1435 and channel operator privileges is set for the client.
1436
1437 When the router joins the client to the channel it must send 
1438 information about newly joined client to all routers in the SILC 
1439 network.  Also, if the channel was created in the process, information
1440 about newly created channel must also be distributed to all routers.
1441 The distribution of newly created channel is done by sending packet
1442 SILC_PACKET_NEW_CHANNEL.
1443
1444 It is important to note that new channel key is created always when
1445 new client joins to channel, whether the channel has existed previously
1446 or not.  This way the new client on the channel is not able to decrypt
1447 any of the old traffic on the channel.
1448
1449 Client who receives the reply to the join command must start using
1450 the received Channel ID in the channel message communication thereafter.
1451 However, client must not start communicating on the channel before
1452 it has received the packet SILC_PACKET_CHANNEL_KEY.
1453
1454 If client wants to know the other clients currently on the channel
1455 the client must send SILC_COMMAND_NAMES command to receive a list of
1456 channel users.  Server implementation, however, may send command reply
1457 packet to SILC_COMMAND_NAMES command after client has joined to the
1458 channel even if the client has not sent the command.
1459
1460
1461 .ti 0
1462 4.4 Channel Key Generation
1463
1464 Channel keys are created by router who creates the channel by taking
1465 enough randomness from cryptographically strong random number generator.
1466 The key is generated always when channel is created, when new client
1467 joins a channel and after the key has expired.  Key could expire for
1468 example in an hour.
1469
1470 The key must also be re-generated whenever some client leaves a channel.
1471 In this case the key is created from scratch by taking enough randomness
1472 from the random number generator.  After that the key is distributed to
1473 all clients on the channel.  However, channel keys are cell specific thus
1474 the key is created only on the cell where the client, who left the
1475 channel, exists.  While the server or router is creating the new channel
1476 key, no other client may join to the channel.  Messages that are sent
1477 while creating the new key are still processed with the old key.  After
1478 server has sent the SILC_PACKET_CHANNEL_KEY packet must client start
1479 using the new key.  If server creates the new key the server must also
1480 send the new key to its router.  See [SILC2] on more information about
1481 how channel messages must be encrypted and decrypted when router is
1482 processing them.
1483
1484
1485 .ti 0
1486 4.5 Private Message Sending and Reception
1487
1488 Private messages are sent point to point.  Client explicitly destines
1489 a private message to specific client that is delivered to only to that
1490 client.  No other client may receive the private message.  The receiver
1491 of the private message is destined in the SILC Packet Header as any
1492 other packet as well.
1493
1494 If the sender of a private message does not know the receiver's Client
1495 ID, it must resolve it from server.  There are two ways to resolve the
1496 client ID from server; it is recommended that client implementations
1497 send SILC_COMMAND_IDENTIFY command to receive the Client ID.  Client
1498 may also send SILC_COMMAND_WHOIS command to receive the Client ID.
1499 If the sender has received earlier a private message from the receiver
1500 it should have cached the Client ID from the SILC Packet Header.
1501
1502 Receiver of a private message should not explicitly trust the nickname
1503 that it receives in the Private Message Payload, described in [SILC2].
1504 Implementations could resolve the nickname from server, as described
1505 previously, and compare the received Client ID and the SILC Packet
1506 Header's Client ID.  The nickname in the payload is merely provided
1507 to be displayed for end user.
1508
1509 See [SILC2] for description of private message encryption and decryption
1510 process.
1511
1512
1513 .ti 0
1514 4.6 Private Message Key Generation
1515
1516 Private message may be protected by key generated by client.  The key
1517 may be generated and sent to the other client by sending packet
1518 SILC_PACKET_PRIVATE_MESSAGE_KEY which travels through the network
1519 and is secured by session keys.  After that the private message key
1520 is used in the private message communication between those clients.
1521 See more information about how this works technically in [SILC2].
1522
1523 Other choice is to entirely use keys that are not sent through
1524 the SILC network at all.  This significantly adds security.  This key
1525 would be pre-shared-key that is known by both of the clients.  Both
1526 agree about using the key and starts sending packets that indicate
1527 that the private message is secured using private message key.  This
1528 is the technical aspect mentioned previously that is described
1529 in [SILC2].
1530
1531 If the private message keys are not set to be used, which is the
1532 case by default in SILC, the private messages are secured by using
1533 normal session keys established by SILC Key Exchange protocol.
1534
1535
1536
1537
1538 .ti 0
1539 4.7 Channel Message Sending and Reception
1540
1541 Channel messages are delivered to group of users.  The group forms a
1542 channel and all clients on the channel receives messages sent to the
1543 channel.
1544
1545 Channel messages are destined to channel by specifying the Channel ID
1546 as Destination ID in the SILC Packet Header.  The server must then
1547 distribute the message to all clients on the channel by sending the
1548 channel message destined explicitly to a client on the channel.
1549
1550 See [SILC2] for description of channel message encryption and decryption
1551 process.
1552
1553
1554 .ti 0
1555 4.8 Session Key Regeneration
1556
1557 Session keys should be regenerated periodically, say, once in an hour.
1558 The re-key process is started by sending SILC_PACKET_REKEY packet to
1559 other end, to indicate that re-key must be performed.
1560
1561 If perfect forward secrecy (PFS) flag was selected in the SILC Key
1562 Exchange protocol [SILC3] the re-key must cause new key exchange with
1563 SKE protocol.  In this case the protocol is secured with the old key
1564 and the protocol results to new key material.  See [SILC3] for more
1565 information.  After the SILC_PACKET_REKEY packet is sent the sender
1566 will perform the SKE protocol.
1567
1568 If PFS flag was not set, which is the default case, then re-key is done
1569 without executing SKE protocol.  In this case, the new key is created by
1570 hashing the old key with hash function selected earlier in the SKE
1571 protocol.  If the digest length of the hash function is too short for the
1572 key, then the key is distributed as described in section Processing the
1573 Key Material in [SILC3].  After both parties has regenerated the session
1574 key, both send SILC_PACKET_REKEY_DONE packet to each other.  These packets
1575 are still secured with the old key.  After these packets, following
1576 packets must be protected with the new key.
1577
1578
1579 .ti 0
1580 4.9 Command Sending and Reception
1581
1582 Client usually sends the commands in the SILC network.  In this case
1583 the client simply sends the command packet to server and the server
1584 processes it and replies with command reply packet.
1585
1586 However, if the server is not able to process the command, it is usually
1587 sent to the server's router.  This is case for example with commands such
1588 as, SILC_COMMAND_JOIN and SILC_COMMAND_WHOIS commands.  However, there
1589 are other commands as well.  For example, if client sends the WHOIS
1590 command requesting specific information about some client the server must
1591 send the WHOIS command to router so that all clients in SILC network
1592 are searched.  The router, on the other hand, sends the WHOIS command
1593 to further to receive the exact information about the requested client.
1594 The WHOIS command travels all the way to the server who owns the client
1595 and it replies with command reply packet.  Finally, the server who
1596 sent the command receives the command reply and it must be able to
1597 determine which client sent the original command.  The server then
1598 sends command reply to the client.  Implementations should have some
1599 kind of cache to handle, for example, WHOIS information.  Servers
1600 and routers along the route could all cache the information for faster
1601 referencing in the future.
1602
1603 The commands sent by server may be sent hop by hop until someone is able
1604 to process the command.  However, it is preferred to destine the command
1605 as precisely as it is possible.  In this case, other routers en route
1606 must route the command packet by checking the true sender and true
1607 destination of the packet.  However, servers and routers must not route
1608 command reply packets to clients coming from other server.  Client
1609 must not accept command reply packet originated from anyone else but
1610 from its own server.
1611
1612
1613 .ti 0
1614 5 SILC Commands
1615
1616 .ti 0
1617 5.1 SILC Commands Syntax
1618
1619 This section briefly describes the syntax of the command notions
1620 in this document.  Every field in command is separated from each
1621 other by whitespaces (` ') indicating that each field is independent
1622 argument and each argument must have own Command Argument Payload.
1623 The number of maximum arguments are defined with each command
1624 separately.  The Command Argument Payload is described in [SILC2].
1625
1626 Every command defines specific number for each argument.  Currently,
1627 they are defined in ascending order; first argument has number one 
1628 (1), second has number two (2) and so on.  This number is set into the
1629 Argument Type field in the Command Argument Payload.  This makes it
1630 possible to send the arguments in free order as the number must be
1631 used to identify the type of the argument.  This makes is it also
1632 possible to have multiple optional arguments in commands and in
1633 command replies.  The number of argument is marked in parentheses
1634 before the actual argument.
1635
1636
1637
1638
1639
1640 .in 6
1641 Example:  Arguments:  (1) <nickname> (2) <username@host>
1642 .in 3
1643    
1644
1645 Every command replies with Status Payload.  This payload tells the
1646 sender of the command whether the command was completed successfully or
1647 whether there was an error.  If error occured the payload includes the
1648 error type.  In the next section the Status Payload is not described 
1649 as it is common to all commands and has been described here.  Commands 
1650 may reply with other arguments as well.  These arguments are command 
1651 specific and are described in the next section.
1652
1653 Example command:
1654 .in 6
1655
1656 EXAMPLE_COMMAND
1657
1658 .in 8
1659 Max Arguments:  3
1660     Arguments:  (1) <nickname>[@<server>]  (2) <message>
1661                 (3) [<count>]
1662
1663 The command has maximum of 3 arguments.  However, only first
1664 and second arguments are mandatory.
1665
1666 First argument <nickname> is mandatory but may have optional
1667 <nickname@server> format as well.  Second argument is mandatory
1668 <message> argument.  Third argument is optional <count> argument.
1669
1670 The numbers in parentheses are the argument specific numbers
1671 that specify the type of the argument in Command Argument Payload.
1672 The receiver always knows that, say, argument number two (2) is
1673 <message> argument, regardless of the ordering of the arguments in
1674 the Command Payload.
1675
1676 Reply messages to the command:
1677
1678 Max Arguments:  4
1679     Arguments:  (1) <Status Payload>  (2) [<channel list>]
1680                 (3) <idle time>       (4) [<away message>]
1681
1682 This command may reply with maximum of 4 arguments.  However,
1683 only the first and third arguments are mandatory.  The numbers
1684 in the parentheses have the same meaning as in the upper
1685 command sending specification.
1686
1687 Every command reply with <Status Payload>, it is mandatory 
1688 argument for all command replies and for this reason it is not
1689 described in the command reply descriptions.
1690
1691
1692
1693 Status messages:
1694
1695     SILC_STATUS_OK
1696     SILC_STATUS_ERR_TOO_MANY_TARGETS
1697     SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1698     SILC_STATUS_ERR_NO_SUCH_NICK
1699
1700 Every command reply also defines set of status message that it
1701 may return inside the <Status Payload>.  All status messages
1702 are defined in the section 5.3 SILC Command Status Types.
1703
1704 Every command that has some kind of ID as argument (for example
1705 <Client ID>) are actually ID Payloads, defined in [SILC2] that includes
1706 the type of the ID, length of the ID and the actual ID data.  This
1707 way variable length ID's can be sent as arguments.
1708 .in 3
1709
1710
1711 .ti 0
1712 5.2 SILC Commands List
1713
1714 This section lists all SILC commands, however, it is expected that a
1715 implementation and especially client implementation has many more
1716 commands that has only local affect.  These commands are official
1717 SILC commands that has both client and server sides and cannot be
1718 characterized as local commands.
1719
1720 List of all defined commands in SILC follows.
1721
1722 .in 0
1723    0    SILC_COMMAND_NONE
1724
1725         None.  This is reserved command and must not be sent.
1726
1727
1728    1    SILC_COMMAND_WHOIS
1729
1730         Max Arguments:  3
1731             Arguments:  (1) <nickname>[@<server>]  (2) [<Client ID>]
1732                         (3) [<count>]
1733
1734         Whois command is used to query various information about specific
1735         user.  The user maybe requested by their nickname and server name.
1736         The query may find multiple matching users as there are no unique
1737         nicknames in the SILC.  The <count> option maybe given to narrow
1738         down the number of accepted results.  If this is not defined there
1739         are no limit of accepted results.  The query may also be narrowed
1740         down by defining the server name of the nickname.
1741
1742         It is also possible to search the user by Client ID.  If <Client ID>
1743         is provided server must use it as the search value instead of
1744         the <nickname>.
1745
1746         To prevent miss-use of this service wildcards in the nickname
1747         or in the servername are not permitted.  It is not allowed
1748         to request all users on some server.  The WHOIS requests must 
1749         be based on specific nickname request.
1750
1751         The WHOIS request must be always forwarded to router by server
1752         so that all users are searched.  However, the server still must
1753         search its locally connected clients.  The server must send
1754         this command to the server who owns the requested client.  That
1755         server must reply to the command.
1756
1757         Reply messages to the command:
1758
1759         Max Arguments:  7
1760             Arguments:  (1) <Status Payload>       (2) <Client ID> 
1761                         (3) <nickname>[@<server>]  (4) <username@host> 
1762                         (5) <real name>            (6) [<channel list>] 
1763                         (7) [<idle time>]
1764
1765         This command may reply with several command reply messages to
1766         form a list of results.  In this case the status payload will
1767         include STATUS_LIST_START status in the first reply and
1768         STATUS_LIST_END in the last reply to indicate the end of the
1769         list.  If there are only one reply the status is set to normal
1770         STATUS_OK.
1771
1772         The command replies include the Client ID of the nickname,
1773         nickname and servername, username and hostname and users real
1774         name.  Client should process these replies only after the last
1775         reply has been received with the STATUS_LIST_END status.  If the
1776         <count> option were defined in the query there will be only
1777         <count> many replies from the server.
1778
1779         Status messages:
1780
1781             SILC_STATUS_OK
1782             SILC_STATUS_LIST_START
1783             SILC_STATUS_LIST_END
1784             SILC_STATUS_ERR_NO_SUCH_NICK
1785             SILC_STATUS_ERR_WILDCARDS
1786             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1787             SILC_STATUS_ERR_TOO_MANY_PARAMS
1788
1789
1790
1791
1792    2    SILC_COMMAND_WHOWAS
1793
1794         Max Arguments:  2
1795             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
1796
1797         Whowas.  This command is used to query history information about
1798         specific user.  The user maybe requested by their nickname and 
1799         server name.  The query may find multiple matching users as there
1800         are no unique nicknames in the SILC.  The <count> option maybe
1801         given to narrow down the number of accepted results.  If this
1802         is not defined there are no limit of accepted results.  The query
1803         may also be narrowed down by defining the server name of the 
1804         nickname.
1805
1806         To prevent miss-use of this service wildcards in the nickname
1807         or in the servername are not permitted.  The WHOWAS requests must 
1808         be based on specific nickname request.
1809
1810         The WHOWAS request must be always forwarded to router by server
1811         so that all users are searched.  However, the server still must
1812         search its locally connected clients.
1813
1814         Reply messages to the command:
1815
1816         Max Arguments:  3
1817             Arguments:  (1) <Status Payload>  (2) <nickname>[@<server>]
1818                         (3) <username@host>
1819
1820         This command may reply with several command reply messages to form
1821         a list of results.  In this case the status payload will include
1822         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1823         the last reply to indicate the end of the list.  If there are only 
1824         one reply the status is set to normal STATUS_OK.
1825
1826         The command replies with nickname and username and hostname.
1827         Every server must keep history for some period of time of its
1828         locally connected clients.
1829
1830         Status messages:
1831
1832             SILC_STATUS_OK
1833             SILC_STATUS_LIST_START
1834             SILC_STATUS_LIST_END
1835             SILC_STATUS_ERR_NO_SUCH_NICK
1836             SILC_STATUS_ERR_WILDCARDS
1837             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1838             SILC_STATUS_ERR_TOO_MANY_PARAMS
1839
1840
1841    3    SILC_COMMAND_IDENTIFY
1842
1843         Max Arguments:  2
1844             Arguments:  (1) <nickname>[@<server>]  (2) [<count>]
1845
1846         Identify.  Identify command is almost analogous to WHOIS command,
1847         except that it does not return as much information.  Only relevant
1848         information such as Client ID is returned.  This is usually used
1849         to get the Client ID of a client used in the communication with
1850         the client.
1851
1852         The query may find multiple matching users as there are no unique 
1853         nicknames in the SILC.  The <count> option maybe given to narrow 
1854         down the number of accepted results.  If this is not defined there 
1855         are no limit of accepted results.  The query may also be narrowed 
1856         down by defining the server name of the nickname.
1857
1858         To prevent miss-use of this service wildcards in the nickname
1859         or in the servername are not permitted.  It is not allowed
1860         to request all users on some server.  The IDENTIFY requests must 
1861         be based on specific nickname request.
1862
1863         Implementations may not want to give interface access to this
1864         command as it is hardly a command that would be used a end user.
1865         However, it must be implemented as it is used with private message
1866         sending.
1867
1868         The IDENTIFY must be always forwarded to router by server so that
1869         all users are searched.  However, server must still search its
1870         locally connected clients.
1871
1872         Reply messages to the command:
1873
1874         Max Arguments:  4
1875             Arguments:  (1) <Status Payload>         (2) <Client ID>
1876                         (3) [<nickname>[@<server>]]  (4) [<username@host>]
1877
1878         This command may reply with several command reply messages to form
1879         a list of results.  In this case the status payload will include
1880         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1881         the last reply to indicate the end of the list.  If there are only 
1882         one reply the status is set to normal STATUS_OK.
1883
1884         The command replies with Client ID of the nickname and if more
1885         information is available it may reply with nickname and username
1886         and hostname.  If the <count> option were defined in the query
1887         there will be only <count> many replies from the server.
1888
1889         Status messages:
1890
1891             SILC_STATUS_OK
1892             SILC_STATUS_LIST_START
1893             SILC_STATUS_LIST_END
1894             SILC_STATUS_ERR_NO_SUCH_NICK
1895             SILC_STATUS_ERR_WILDCARDS
1896             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1897             SILC_STATUS_ERR_TOO_MANY_PARAMS
1898
1899
1900    4    SILC_COMMAND_NICK
1901
1902         Max Arguments:  1
1903             Arguments:  (1) <nickname>
1904
1905         Set/change nickname.  This command is used to set nickname for
1906         user.  There is no limit of the length of the nickname in SILC.
1907         Nickname must not include any spaces (` '), non-printable
1908         characters, commas (`,') and any wildcard characters.  Note:
1909         nicknames in SILC are case-sensitive which must be taken into
1910         account when searching clients by nickname.
1911
1912         Reply messages to the command:
1913
1914         Max Arguments:  2
1915             Arguments:  (1) <Status Payload>  (2) <New ID Payload>
1916
1917         This command is replied always with New ID Payload that is
1918         generated by the server every time user changes their nickname.
1919         Client receiving this payload must start using the received
1920         Client ID as its current valid Client ID.  The New ID Payload
1921         is described in [SILC2].
1922
1923         Status messages:
1924
1925             SILC_STATUS_OK
1926             SILC_STATUS_ERR_WILDCARDS
1927             SILC_STATUS_ERR_NICKNAME_IN_USE
1928             SILC_STATUS_ERR_BAD_NICKNAME
1929             SILC_STATUS_ERR_NOT_REGISTERED
1930             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
1931             SILC_STATUS_ERR_TOO_MANY_PARAMS
1932
1933
1934
1935
1936
1937
1938    5    SILC_COMMAND_LIST
1939
1940         Max Arguments:  2
1941             Arguments:  (1) [<Channel ID>] [<server>]
1942
1943         The list command is used to list channels and their topics on
1944         current server.  If the <Channel ID> parameter is used, only the
1945         status of that channel is displayed.  Secret channels are not
1946         listed at all.  Private channels are listed with status indicating
1947         that the channel is private.
1948
1949         If the <server> argument is specified the specified server's
1950         channels are listed.  In this case the command must be sent to
1951         the server who owns the channel that was requested.
1952
1953         Reply messages to the command:
1954
1955         Max Arguments:  4
1956             Arguments:  (1) <Status Payload>  (2) <Channel ID>
1957                         (3) <channel>         (4) <topic>
1958
1959         This command may reply with several command reply messages to form
1960         a list of results.  In this case the status payload will include
1961         STATUS_LIST_START status in the first reply and STATUS_LIST_END in 
1962         the last reply to indicate the end of the list.  If there are only 
1963         one reply the status is set to normal STATUS_OK.
1964
1965         This command replies with Channel ID, name and the topic of the
1966         channel.  If the channel is private channel the <topic> includes
1967         "*private*" string.
1968
1969         Status messages:
1970
1971             SILC_STATUS_OK
1972             SILC_STATUS_LIST_START
1973             SILC_STATUS_LIST_END
1974             SILC_STATUS_ERR_WILDCARDS
1975             SILC_STATUS_ERR_NOT_REGISTERED
1976             SILC_STATUS_ERR_TOO_MANY_PARAMS
1977             SILC_STATUS_ERR_NO_SUCH_CHANNEL
1978             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
1979             SILC_STATUS_ERR_NO_SUCH_SERVER
1980
1981
1982    6    SILC_COMMAND_TOPIC
1983
1984         Max Arguments:  2
1985             Arguments:  (1) <Channel ID>  (2) [<topic>]]
1986
1987         This command is used to change or view the topic of a channel.
1988         The topic for channel <Channel ID> is returned if there is no
1989         <topic> given.  If the <topic> parameter is present, the topic
1990         for that channel will be changed, if the channel modes permit
1991         this action.
1992
1993         Reply messages to the command:
1994
1995         Max Arguments:  2
1996             Arguments:  (1) <Status Payload>  (2) [<topic>]
1997
1998         The command may reply with the topic of the channel if it is
1999         set.
2000
2001         Status messages:
2002
2003             SILC_STATUS_OK
2004             SILC_STATUS_ERR_NOT_ON_CHANNEL
2005             SILC_STATUS_ERR_WILDCARDS
2006             SILC_STATUS_ERR_NOT_REGISTERED
2007             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2008             SILC_STATUS_ERR_NO_SUCH_CHANNEL
2009             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2010             SILC_STATUS_ERR_NO_CHANNEL_ID
2011             SILC_STATUS_ERR_BAD_CHANNEL_ID
2012             SILC_STATUS_ERR_TOO_MANY_PARAMS
2013             SILC_STATUS_ERR_NO_CHANNEL_PRIV
2014
2015
2016    7    SILC_COMMAND_INVITE
2017
2018         Max Arguments:  2
2019             Arguments:  (1) <Client ID>  (2) <Channel ID>
2020
2021         This command is used to invite other clients to join to the
2022         channel.  The <Client ID> argument is the target client's ID that
2023         is being invited.  The <Channel ID> is the Channel ID of the
2024         requested channel.  The sender of this command must be on the
2025         channel.  This command must fail if the requested channel does
2026         not exist, the requested client is already on the channel or if
2027         the channel is invite only channel and the caller of this command
2028         does not have at least channel operator privileges.
2029
2030         Reply messages to the command:
2031
2032         Max Arguments:  2
2033             Arguments:  (1) <Status Payload>
2034
2035         This command replies only with Status Payload.
2036
2037         Status messages:
2038
2039             SILC_STATUS_OK
2040             SILC_STATUS_ERR_NOT_REGISTERED
2041             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2042             SILC_STATUS_ERR_TOO_MANY_PARAMS
2043             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2044             SILC_STATUS_ERR_NO_CLIENT_ID
2045             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2046             SILC_STATUS_ERR_NO_CHANNEL_ID
2047             SILC_STATUS_ERR_NOT_ON_CHANNEL
2048             SILC_STATUS_ERR_USER_ON_CHANNEL
2049
2050
2051    8    SILC_COMMAND_QUIT
2052
2053         Max Arguments:  1
2054             Arguments:  (1) [<quit message>]
2055
2056         This command is used by client to end SILC session.  The server
2057         must close the connection to a client which sends this command.
2058         if <quit message> is given it will be sent to other clients on
2059         channel if the client is on channel when quitting.
2060
2061         Reply messages to the command:
2062
2063         This command does not reply anything.
2064
2065
2066     9   SILC_COMMAND_KILL
2067
2068         Max Arguments:  2
2069             Arguments:  (1) <Client ID>  (2) [<comment>]
2070
2071         This command is used by SILC operators to remove a client from
2072         SILC network.  The removing has temporary effects and client may
2073         reconnect to SILC network.  The <Client ID> is the client to be
2074         removed from SILC.  The <comment> argument may be provided to 
2075         give to the removed client some information why it was removed
2076         from the network.
2077
2078         Reply messages to the command:
2079
2080         Max Arguments:  1
2081             Arguments:  (1) <Status Payload>
2082
2083         This command replies only with Status Payload.
2084
2085         Status messages:
2086
2087             SILC_STATUS_OK
2088             SILC_STATUS_ERR_WILDCARDS
2089             SILC_STATUS_ERR_NOT_REGISTERED
2090             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2091             SILC_STATUS_ERR_TOO_MANY_PARAMS
2092             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2093             SILC_STATUS_ERR_NO_CLIENT_ID
2094
2095
2096
2097    10   SILC_COMMAND_INFO
2098
2099         Max Arguments:  1
2100             Arguments:  (1) [<server>]
2101
2102         This command is used to fetch various information about a server.
2103         If <server> argument is specified the command must be sent to
2104         the requested server.
2105
2106         Reply messages to the command:
2107
2108         Max Arguments:  3
2109             Arguments:  (1) <Status Payload>  (2) <Server ID>
2110                         (3) <string>
2111
2112         This command replies with the Server ID of the server and a
2113         string which tells the information about the server.
2114
2115         Status messages:
2116
2117             SILC_STATUS_OK
2118             SILC_STATUS_ERR_WILDCARDS
2119             SILC_STATUS_ERR_NOT_REGISTERED
2120             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2121             SILC_STATUS_ERR_TOO_MANY_PARAMS
2122             SILC_STATUS_ERR_NO_SUCH_SERVER
2123
2124
2125    11   SILC_COMMAND_CONNECT
2126
2127         Max Arguments:  2
2128             Arguments:  (1) <Server ID>  
2129                         (2) [<remote server/router>[ <port>]]
2130
2131         This command is used by operators to force a server to try to
2132         establish a new connection to another router (if the connecting
2133         server is normal server) or server (if the connecting server is
2134         router server).  Operator may specify the server/router to be
2135         connected by setting <remote server> argument.  The separator
2136         between <remote server address> and <port> is whitespace (` ').
2137
2138         Reply messages to the command:
2139
2140         Max Arguments:  1
2141             Arguments:  (1) <Status Payload>
2142
2143         This command replies only with Status Payload.
2144
2145
2146
2147         Status messages:
2148
2149             SILC_STATUS_OK
2150             SILC_STATUS_ERR_WILDCARDS
2151             SILC_STATUS_ERR_NOT_REGISTERED
2152             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2153             SILC_STATUS_ERR_TOO_MANY_PARAMS
2154             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2155             SILC_STATUS_ERR_NO_SERVER_PRIV
2156             SILC_STATUS_ERR_NO_ROUTER_PRIV
2157
2158
2159    12   SILC_COMMAND_PING
2160
2161         Max Arguments:  1
2162             Arguments:  (1) <Server ID>
2163
2164         This command is used by client and server to test the communication
2165         channel to its server if one suspects that the communication is not
2166         working correctly.  The <Server ID> is the ID of the server the
2167         sender is connected to.
2168
2169         Reply messages to the command:
2170
2171         Max Arguments:  1
2172             Arguments:  (1) <Status Payload>
2173
2174         This command replies only with Status Payload.  Server returns
2175         SILC_STATUS_OK in Status Payload if pinging was successful.
2176
2177
2178
2179         Status messages:
2180
2181             SILC_STATUS_OK
2182             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2183             SILC_STATUS_ERR_TOO_MANY_PARAMS
2184             SILC_STATUS_ERR_NO_SERVER_ID
2185             SILC_STATUS_ERR_NO_SUCH_SERVER
2186             SILC_STATUS_ERR_NOT_REGISTERED
2187
2188
2189    13   SILC_COMMAND_OPER
2190
2191         Max Arguments:  2
2192             Arguments:  (1) <username>  (2) <authentication data>
2193
2194         This command is used by normal client to obtain server operator
2195         privileges on some server or router.  Note that router operator
2196         has router privileges that supersedes the server operator
2197         privileges and this does not obtain those privileges.  Client
2198         must use SILCOPER command to obtain router level privileges.
2199
2200         The <username> is the username set in the server configurations
2201         as operator.  The <authentication data> is the data that the
2202         client is authenticated against.  It may be passphrase prompted
2203         for user on client's screen or it may be public key
2204         authentication data (data signed with private key), or 
2205         certificate.
2206
2207         Reply messages to the command:
2208
2209         Max Arguments:  1
2210             Arguments:  (1) <Status Payload>
2211
2212         This command replies only with Status Payload.
2213
2214         Status messages:
2215
2216             SILC_STATUS_OK
2217             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2218             SILC_STATUS_ERR_TOO_MANY_PARAMS
2219             SILC_STATUS_ERR_NOT_REGISTERED
2220             SILC_STATUS_ERR_BAD_PASSWORD
2221             SILC_STATUS_ERR_AUTH_FAILED
2222
2223
2224
2225
2226
2227    14   SILC_COMMAND_JOIN
2228
2229         Max Arguments:  3
2230             Arguments:  (1) <channel>  (2) [<passphrase>] 
2231                         (3) [<cipher>]
2232
2233         Join to channel/create new channel.  This command is used to
2234         join to a channel.  If the channel does not exist the channel is
2235         created.  If server is normal server this command must be forwarded
2236         to router who will create the channel.  The channel may be protected
2237         with passphrase.  If this is the case the passphrase must be sent
2238         along the join command.
2239
2240         The name of the <channel> must not include any spaces (` '),
2241         non-printable characters, commas (`,') or any wildcard characters.
2242
2243         Cipher to be used to secure the traffic on the channel may be
2244         requested by sending the name of the requested <cipher>.  This
2245         is used only if the channel does not exist and is created.  If
2246         the channel already exists the cipher set previously for the
2247         channel will be used to secure the traffic.
2248
2249         The server must check whether the user is allowed to join to
2250         the requested channel.  Various modes set to the channel affect
2251         the ability of the user to join the channel.  These conditions
2252         are:
2253
2254             o  The user must be invited to the channel if the channel
2255                is invite-only channel.
2256
2257             o  The Client ID/nickname/username/hostname must not match
2258                any active bans.
2259
2260             o  The correct passphrase must be provided if passphrase 
2261                is set to the channel.
2262
2263             o  The user count limit, if set, must not be reached.
2264
2265         Reply messages to the command:
2266
2267         Max Arguments:  5
2268             Arguments:  (1) <Status Payload>  (2) <channel> 
2269                         (3) <Channel ID>      (4) <channel mode mask>
2270                         (5) [<ban mask>]      (6) [<invite list>]
2271                         (6) [<topic>]
2272
2273         This command replies with the channel name requested by the
2274         client, channel ID of the channel and topic of the channel
2275         if it exists.  It also replies with the channel mode mask
2276         which tells all the modes set on the channel.  If the
2277         channel is created the mode mask is zero (0).  If ban mask
2278         and/or invite list is set they are sent as well.
2279
2280         Client must not start transmitting to the channel even after
2281         server has replied to this command.  Client is permitted to 
2282         start transmitting on channel after server has sent packet 
2283         SILC_PACKET_CHANNEL_KEY to the client.
2284
2285         Status messages:
2286
2287             SILC_STATUS_OK
2288             SILC_STATUS_ERR_WILDCARDS
2289             SILC_STATUS_ERR_NOT_REGISTERED
2290             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2291             SILC_STATUS_ERR_TOO_MANY_PARAMS
2292             SILC_STATUS_ERR_BAD_PASSWORD
2293             SILC_STATUS_ERR_CHANNEL_IS_FULL
2294             SILC_STATUS_ERR_NOT_INVITED
2295             SILC_STATUS_ERR_BANNED_FROM_CHANNEL
2296             SILC_STATUS_ERR_BAD_CHANNEL
2297             SILC_STATUS_ERR_USER_ON_CHANNEL
2298
2299
2300    15   SILC_COMMAND_MOTD
2301
2302         Max Arguments:  1
2303             Arguments:  (1) <server>
2304
2305         This command is used to query the Message of the Day of a server.
2306
2307         Reply messages to the command:
2308
2309         Max Arguments:  2
2310             Arguments:  (1) <Status Payload>  (2) [<motd>]
2311
2312         This command replies with the motd message if it exists.
2313
2314         Status messages:
2315
2316             SILC_STATUS_OK
2317             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2318             SILC_STATUS_ERR_TOO_MANY_PARAMS
2319             SILC_STATUS_ERR_NOT_REGISTERED
2320             SILC_STATUS_ERR_NO_SUCH_SERVER
2321
2322
2323    16   SILC_COMMAND_UMODE
2324
2325         Max Arguments:  2
2326             Arguments:  (1) <Client ID>  (2) <client mode mask>
2327
2328         This command is used by client to set/unset modes for itself.
2329         However, there are some modes that the client may not set itself,
2330         but they will be set by server.  However, client may unset any
2331         mode.  Modes may be masked together ORing them thus having
2332         several modes set.  Client must keep its client mode mask
2333         locally so that the mode setting/unsetting would work without
2334         problems.  Client may change only its own modes.
2335
2336         Following client modes are defined:
2337
2338            0x0000    SILC_UMODE_NONE
2339
2340               No specific mode for client.  This is the initial
2341               setting when new client is created.  The client is
2342               normal client now.
2343
2344
2345            0x0001    SILC_UMODE_SERVER_OPERATOR
2346
2347               Marks the user as server operator.  Client cannot
2348               set this mode itself.  Server sets this mode to the
2349               client when client attains the server operator
2350               privileges by SILC_COMMAND_OPER command.  Client
2351               may unset the mode itself.
2352
2353
2354            0x0002    SILC_UMODE_ROUTER_OPERATOR
2355
2356               Marks the user as router (SILC) operator.  Client
2357               cannot this mode itself.  Router sets this mode to
2358               the client when client attains the router operator
2359               privileges by SILC_COMMAND_SILCOPER command.  Client
2360               may unset the mode itself.
2361
2362         Reply messages to the command:
2363
2364         Max Arguments:  2
2365             Arguments:  (1) <Status Payload>  (2) <client mode mask>
2366
2367         This command replies with the changed client mode mask that
2368         the client is required to keep locally.
2369
2370
2371         Status messages:
2372
2373             SILC_STATUS_OK
2374             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2375             SILC_STATUS_ERR_TOO_MANY_PARAMS
2376             SILC_STATUS_ERR_NOT_REGISTERED
2377             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2378             SILC_STATUS_ERR_BAD_CLIENT_ID
2379             SILC_STATUS_ERR_NOT_YOU
2380             SILC_STATUS_ERR_UNKNOWN_MODE
2381             SILC_STATUS_ERR_NO_RECIPIENT
2382             SILC_STATUS_ERR_NO_CLIENT_ID
2383
2384
2385    17   SILC_COMMAND_CMODE
2386
2387         Max Arguments:  8
2388             Arguments:  (1) <Channel ID>    (2) <channel mode mask>
2389                         (3) [<user limit>]  (4) [<passphrase>]
2390                         (5) [<ban mask>]    (6) [<invite list>]
2391                         (7) [<Client ID>]   (8) [<cipher>[:<key len>]]
2392
2393         This command is used by client to set or change channel flags on
2394         a channel.  Channel has several modes that set various properties
2395         of a channel.  Modes may be masked together by ORing them thus
2396         having several modes set.  The <Channel ID> is the ID of the
2397         target channel.  The client changing channel mode must be on
2398         the same channel and poses sufficient privileges to be able to
2399         change the mode.
2400
2401         Following channel modes are defined:
2402
2403            0x0000    SILC_CMODE_NONE
2404
2405               No specific mode on channel.  This is the default when
2406               channel is created.  This means that channel is just plain
2407               normal channel.
2408
2409
2410            0x0001    SILC_CMODE_PRIVATE
2411
2412               Channel is private channel.  Private channels are shown
2413               in the channel list listed with SILC_COMMAND_LIST command
2414               with indication that the channel is private.  Also,
2415               client on private channel will no be detected to be on
2416               the channel as the channel is not shown in the client's
2417               currently joined channel list.  Channel founder and 
2418               channel operator may set/unset this mode.
2419
2420               Typical implementation would use [+|-]p on user interface
2421               to set/unset this mode.
2422
2423
2424            0x0002    SILC_CMODE_SECRET
2425
2426               Channel is secret channel.  Secret channels are not shown
2427               in the list listed with SILC_COMMAND_LIST command.  Secret
2428               channels can be considered to be invisible channels.
2429               Channel founder and channel operator may set/unset this
2430               mode.
2431
2432               Typical implementation would use [+|-]s on user interface
2433               to set/unset this mode.
2434
2435
2436            0x0004    SILC_CMODE_PRIVKEY
2437
2438               Channel uses private channel key to protect the traffic
2439               on the channel.  When this mode is set the client will be
2440               responsible to set the key it wants to use to encrypt and
2441               decrypt the traffic on channel.  Server generated channel
2442               keys are not used at all.  This mode provides additional
2443               security as clients on channel may agree to use private
2444               channel key that even servers do not know.  Naturally,
2445               this requires that every client on the channel knows
2446               the key before hand (it is considered to be pre-shared-
2447               key).  This specification does not define how the private
2448               channel key is set as it is entirely local setting on
2449               client end.
2450
2451               As it is local setting it is possible to have several
2452               private channel keys on one channel.  In this case several
2453               clients can talk on same channel but only those clients
2454               that share the key with the message sender will be able
2455               to hear the talking.  Client should not display those
2456               message for the end user that it is not able to decrypt
2457               when this mode is set.
2458
2459               Only channel founder may set/unset this mode.  If this
2460               mode is unset the server will distribute new channel
2461               key to all clients on the channel which will be used
2462               thereafter.
2463
2464               Typical implementation would use [+|-]k on user interface
2465               to set/unset this mode.
2466
2467
2468            0x0008    SILC_CMODE_INVITE
2469
2470               Channel is invite only channel.  Client may join to this
2471               channel only if it is invited to the channel.  Channel
2472               founder and channel operator may set/unset this mode.
2473
2474               Typical implementation would use [+|-]i on user interface
2475               to set/unset this mode.
2476
2477
2478            0x0010    SILC_CMODE_TOPIC
2479
2480               The topic of the channel may only be set by client that
2481               is channel founder or channel operator.  Normal clients
2482               on channel will not be able to set topic when this mode
2483               is set.  Channel founder and channel operator may set/
2484               unset this mode.
2485
2486               Typical implementation would use [+|-]t on user interface
2487               to set/unset this mode.
2488
2489
2490            0x0020    SILC_CMODE_ULIMIT
2491
2492               User limit has been set to the channel.  New clients
2493               may not join to the channel when the limit set is
2494               reached.  Channel founder and channel operator may set/
2495               unset the limit.  The <user limit> argument is the
2496               number of limited users.
2497
2498               Typical implementation would use [+|-]l on user interface
2499               to set/unset this mode.
2500
2501
2502            0x0040    SILC_CMODE_PASSPHRASE
2503
2504               Passphrase has been set to the channel.  Client may
2505               join to the channel only if it is able to provide the
2506               correct passphrase.  Setting passphrases to channel
2507               is entirely safe as all commands are protected in the
2508               SILC network.  Only channel founder may set/unset
2509               the passphrase.  The <passphrase> argument is the
2510               set passphrase.
2511
2512               Typical implementation would use [+|-]a on user interface
2513               to set/unset this mode.
2514
2515
2516            0x0080    SILC_CMODE_BAN
2517
2518               Ban mask has been set to the channel.  The ban mask
2519               may be used to ban specific clients to join the channel.
2520               The <ban mask> argument is the set ban mask.  When
2521               unsetting a ban mask the mask must be provided as
2522               argument.  Channel founder and channel operator may
2523               set/unset this mode.  Channel founder may not be
2524               added to the ban list.
2525
2526               Typical implementation would use [+|-]b on user interface
2527               to set/unset this mode.
2528
2529
2530            0x0100    SILC_CMODE_INVITE
2531
2532               Invite list has been set to the channel.  The invite list
2533               can be used to mark the clients that is able to join
2534               channel without being invited when the channel is set to
2535               be invite-only channel.  The <invite list> argument is the
2536               set invite mask.  When unsetting entry from the invite list
2537               the entry must be provided as argument.  Channel founder and
2538               channel operator may set/unset this mode.
2539
2540               Typical implementation would use [+|-]I on user interface
2541               to set/unset this mode.
2542
2543         
2544            0x0200    SILC_CMODE_OPERATOR
2545
2546               Sets channel operator privileges on the channel for a
2547               client on the channel.  The <Client ID> argument is the
2548               target client on the channel.  Channel founder and
2549               channel operator may set/unset (promote/demote) this
2550               mode.
2551
2552               Typical implementation would use [+|-]o on user interface
2553               to set/unset this mode.
2554
2555
2556            0x0400    SILC_CMODE_CIPHER
2557
2558               Sets specific cipher to be used to protect channel
2559               traffic.  The <cipher> argument is the requested cipher.
2560               When set or unset the server must re-generate new
2561               channel key.  If <key len> argument is specified with
2562               <cipher> argument the new key is generated of <key len>
2563               length.
2564
2565               Typical implementation would use [+|-]c on user interface
2566               to set/unset this mode.
2567
2568
2569         To make the mode system work, client must keep the channel mode
2570         mask locally so that the mode setting and unsetting would work
2571         without problems.  The client receives the initial channel mode
2572         mask when it joins to the channel.  When the mode changes on
2573         channel the server distributes the changed channel mode mask to
2574         all clients on the channel by sending SILC_COMMAND_CMODE command
2575         reply packet.
2576
2577
2578         Reply messages to the command:
2579
2580         Max Arguments:  2
2581             Arguments:  (1) <Status Payload>  (2) <channel mode mask>
2582
2583         This command replies with the changed channel mode mask that
2584         client is required to keep locally.  The same mask is also
2585         sent to all clients on channel by sending additional command
2586         reply to them.
2587
2588         Status messages:
2589
2590             SILC_STATUS_OK
2591             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2592             SILC_STATUS_ERR_TOO_MANY_PARAMS
2593             SILC_STATUS_ERR_NOT_REGISTERED
2594             SILC_STATUS_ERR_NOT_ON_CHANNEL
2595             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2596             SILC_STATUS_ERR_BAD_CHANNEL_ID
2597             SILC_STATUS_ERR_NO_CHANNEL_ID
2598             SILC_STATUS_ERR_NO_CHANNEL_PRIV
2599             SILC_STATUS_ERR_UNKNOWN_MODE
2600             SILC_STATUS_ERR_NO_CLIENT_ID
2601
2602
2603
2604
2605    18   SILC_COMMAND_KICK
2606
2607         Max Arguments:  3
2608             Arguments:  (1) <channel>  (2) <Client ID>  
2609                         (3) [<comment>]
2610
2611         This command is used by channel operators to remove a client from
2612         channel.  The <channel> argument is the channel the client to be
2613         removed is on currently.  Note that the "kicker" must be on the same
2614         channel.  If <comment> is provided it will be sent to the removed
2615         client.
2616
2617         Reply messages to the command:
2618
2619         Max Arguments:  1
2620             Arguments:  (1) <Status Payload>
2621
2622         This command replies only with Status Payload.
2623
2624         Status messages:
2625
2626             SILC_STATUS_OK
2627             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2628             SILC_STATUS_ERR_TOO_MANY_PARAMS
2629             SILC_STATUS_ERR_NOT_REGISTERED
2630             SILC_STATUS_ERR_NO_SUCH_CHANNEL
2631             SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2632             SILC_STATUS_ERR_NO_CHANNEL_PRIV
2633             SILC_STATUS_ERR_NO_CLIENT_ID
2634
2635
2636    19   SILC_COMMAND_RESTART
2637
2638         Max Arguments:  0
2639             Arguments:  None
2640
2641         This command may only be used by server operator to force a
2642         server to restart itself.
2643
2644         Reply messages to the command:
2645
2646         Max Arguments:  1
2647             Arguments:  (1) <Status Payload>
2648
2649         This command replies only with Status Payload.
2650
2651         Status messages:
2652
2653             SILC_STATUS_OK
2654             SILC_STATUS_ERR_NOT_REGISTERED
2655             SILC_STATUS_ERR_NO_SERVER_PRIV
2656
2657
2658
2659
2660
2661    20   SILC_COMMAND_CLOSE
2662
2663         Max Arguments:  1
2664             Arguments:  (1) <Server ID>
2665
2666         This command is used only by operator to close connection to a
2667         remote site.  The <Server ID> argument is the ID of the remote
2668         site and must be valid.
2669
2670         Reply messages to the command:
2671
2672         Max Arguments:  1
2673             Arguments:  (1) <Status Payload>
2674
2675         This command replies only with Status Payload.
2676
2677         Status messages:
2678
2679             SILC_STATUS_OK
2680             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2681             SILC_STATUS_ERR_TOO_MANY_PARAMS
2682             SILC_STATUS_ERR_NOT_REGISTERED
2683             SILC_STATUS_ERR_NO_SUCH_SERVER
2684             SILC_STATUS_ERR_NO_SERVER_PRIV
2685             SILC_STATUS_ERR_NO_SUCH_SERVER_ID
2686
2687
2688    21   SILC_COMMAND_DIE
2689
2690         Max Arguments:  0
2691             Arguments:  None
2692
2693         This command is used only by operator to shutdown the server.
2694         All connections to the server will be closed and the server is
2695         shutdown.
2696
2697         Reply messages to the command:
2698
2699
2700
2701         Max Arguments:  1
2702             Arguments:  (1) <Status Payload>
2703
2704         This command replies only with Status Payload.
2705
2706         Status messages:
2707
2708             SILC_STATUS_OK
2709             SILC_STATUS_ERR_NOT_REGISTERED
2710             SILC_STATUS_ERR_NO_SERVER_PRIV
2711
2712
2713    22   SILC_COMMAND_SILCOPER
2714
2715         Max Arguments:  2
2716             Arguments:  (1) <username>  (2) <authentication data>
2717
2718         This command is used by normal client to obtain router operator
2719         privileges (also known as SILC operator) on some router.  Note
2720         that router operator has router privileges that supersedes the
2721         server operator privileges.
2722
2723         The <username> is the username set in the server configurations
2724         as operator.  The <authentication data> is the data that the
2725         client is authenticated against.  It may be passphrase prompted
2726         for user on client's screen or it may be public key
2727         authentication data (data signed with private key), or 
2728         certificate.
2729
2730         Difference between router operator and server operator is that
2731         router operator is able to handle cell level properties while
2732         server operator (even on router server) is able to handle only
2733         local properties, such as, local connections and normal server
2734         administration.
2735
2736         Reply messages to the command:
2737
2738         Max Arguments:  1
2739             Arguments:  (1) <Status Payload>
2740
2741         This command replies only with Status Payload.
2742
2743         Status messages:
2744
2745             SILC_STATUS_OK
2746             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2747             SILC_STATUS_ERR_TOO_MANY_PARAMS
2748             SILC_STATUS_ERR_NOT_REGISTERED
2749             SILC_STATUS_ERR_BAD_PASSWORD
2750             SILC_STATUS_ERR_AUTH_FAILED
2751
2752
2753    23   SILC_COMMAND_LEAVE
2754
2755         Max Arguments:  1
2756             Arguments:  (1) <Channel ID>
2757
2758         This command is used by client to leave a channel the client is
2759         joined to.  After a client has leaved the channel the server
2760         must create new key for the channel and distribute to all clients
2761         still currently on the channel.
2762
2763         Reply messages to the command:
2764
2765         Max Arguments:  1
2766             Arguments:  (1) <Status Payload>
2767
2768         This command replies only with Status Payload.
2769
2770         Status messages:
2771
2772             SILC_STATUS_OK
2773             SILC_STATUS_ERR_NOT_REGISTERED
2774             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2775             SILC_STATUS_ERR_TOO_MANY_PARAMS
2776             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2777             SILC_STATUS_ERR_BAD_CHANNEL_ID
2778             SILC_STATUS_ERR_NO_CHANNEL_ID
2779
2780
2781    24   SILC_COMMAND_NAMES
2782
2783         Max Arguments:  1
2784             Arguments:  (1) <Channel ID>
2785
2786         This command is used to list user names currently on the requested
2787         channel; argument <Channel ID>.  The server must resolve the
2788         user names and send a comma (`,') separated list of user names
2789         on the channel.  Server or router may resolve the names by sending
2790         SILC_COMMAND_WHOIS commands.
2791
2792         If the requested channel is a private or secret channel, this
2793         command must not send the list of users, as private and secret
2794         channels cannot be seen by outside.  In this case the returned
2795         name list may include a indication that the server could not 
2796         resolve the names of the users on the channel.
2797
2798         Reply messages to the command:
2799
2800         Max Arguments:  3
2801             Arguments:  (1) <Status Payload>  (2) <Channel ID>
2802                         (3) <name list>       (4) <Client ID list>
2803
2804         This command replies with the Channel ID of the requested channel,
2805         comma separated list of users on the channel and Client ID list
2806         of the users on the list.  The Client ID list has Client ID's
2807         of all users in the list.  First Client ID in the list must be
2808         the Client ID of the first user in <name list>.  The Client ID
2809         List is formed by adding Client ID's each after each.  Note that
2810         the Client ID list is binary data.
2811
2812         Status messages:
2813
2814             SILC_STATUS_OK
2815             SILC_STATUS_ERR_NOT_REGISTERED
2816             SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
2817             SILC_STATUS_ERR_TOO_MANY_PARAMS
2818             SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2819             SILC_STATUS_ERR_BAD_CHANNEL_ID
2820             SILC_STATUS_ERR_NO_CHANNEL_ID
2821             SILC_STATUS_ERR_NOT_ON_CHANNEL
2822
2823
2824    25 - 199
2825
2826         Currently undefined commands.
2827
2828
2829    200 - 254
2830
2831         These commands are reserved for private use and will not be defined
2832         in this document.
2833
2834
2835    255  SILC_COMMAND_MAX   
2836
2837         Reserved command.  This must not be sent.
2838 .in 3
2839
2840
2841 .ti 0
2842 5.3 SILC Command Status Types
2843
2844 .ti 0
2845 5.3.1 SILC Command Status Payload
2846
2847 Command Status Payload is sent in command reply messages to indicate
2848 the status of the command.  The payload is one of argument in the
2849 command thus this is the data area in Command Argument Payload described
2850 in [SILC2].  The payload is only 2 bytes of length.  Following diagram
2851 represents the Command Status Payload (field is always in MSB order).
2852
2853
2854
2855
2856
2857 .in 21
2858 .nf
2859                      1
2860  0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
2861 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2862 |        Status Message         |
2863 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2864 .in 3
2865
2866 .ce
2867 Figure 6:  SILC Command Status Payload
2868
2869
2870 .in 6
2871 o Status Message (2 bytes) - Indicates the status message.
2872   All Status messages are described in the next section.
2873 .in 3
2874
2875
2876 .ti 0
2877 5.3.2 SILC Command Status List
2878
2879 Command Status messages are returned in the command reply messages
2880 to indicate whether the command were executed without errors.  If error
2881 has occured the status tells which error occured.  Status payload only
2882 sends numeric reply about the status.  Receiver of the payload must
2883 convert the numeric values into human readable error messages.  The
2884 list of status messages below has an example human readable error
2885 messages that client may display for the user.
2886
2887 List of all defined command status messages following.
2888
2889 .in 0
2890    Generic status messages:
2891
2892    0    SILC_STATUS_OK
2893
2894         Ok status.  Everything went Ok.  The status payload maybe
2895         safely ignored in this case.
2896
2897    1    SILC_STATUS_LIST_START
2898
2899         Start of the list.  There will be several command replies and
2900         this reply is the start of the list.
2901
2902    2    SILC_STATUS_LIST_END
2903
2904         End of the list.  There were several command replies and this
2905         reply is the last of the list.  There won't be other replies
2906         belonging to this list after this one.
2907
2908    3 - 9
2909
2910         Currently undefined and has been reserved for the future.
2911
2912
2913    Error status message:
2914
2915    10   SILC_STATUS_ERR_NO_SUCH_NICK
2916
2917         "No such nickname".  Requested nickname does not exist.
2918
2919    11   SILC_STATUS_ERR_NO_SUCH_CHANNEL
2920
2921         "No such channel".  Requested channel name does not exist.
2922
2923    12   SILC_STATUS_ERR_NO_SUCH_SERVER
2924
2925         "No such server".  Requested server name does not exist.
2926
2927    13   SILC_STATUS_ERR_TOO_MANY_TARGETS
2928
2929         "Duplicate recipients. No message delivered".  Message were
2930         tried to be sent to recipient which has several occurrences in 
2931         the recipient list.
2932
2933    14   SILC_STATUS_ERR_NO_RECIPIENT
2934
2935         "No recipient given".  Command required recipient which was
2936         not provided.
2937
2938    15   SILC_STATUS_ERR_UNKNOWN_COMMAND
2939
2940         "Unknown command".  Command sent to server is unknown by the
2941         server.
2942
2943    16   SILC_STATUS_ERR_WILDCARDS
2944
2945         "Wildcards cannot be used".  Wildcards were provided but they
2946         weren't permitted.
2947
2948    17   SILC_STATUS_ERR_NO_CLIENT_ID
2949
2950         "No Client ID given".  Client ID were expected as command
2951         parameter but were not found.
2952
2953    18   SILC_STATUS_ERR_NO_CHANNEL_ID
2954
2955         "No Channel ID given".  Channel ID were expected as command
2956         parameter but were not found.
2957
2958    19   SILC_STATUS_ERR_NO_SERVER_ID
2959
2960         "No Serve ID given".  Server ID were expected as command
2961         parameter but were not found.
2962
2963    20   SILC_STATUS_ERR_BAD_CLIENT_ID
2964
2965         "Bad Client ID".  Client ID provided were erroneous.
2966
2967    21   SILC_STATUS_ERR_BAD_CHANNEL_ID
2968
2969         "Bad Channel ID".  Channel ID provided were erroneous.
2970
2971    22   SILC_STATUS_ERR_NO_SUCH_CLIENT_ID
2972
2973         "No such Client ID".  Client ID provided does not exist.
2974
2975
2976    23   SILC_STATUS_ERR_NO_SUCH_CHANNEL_ID
2977
2978         "No such Channel ID".  Channel ID provided does not exist.
2979
2980    24   SILC_STATUS_ERR_NICKNAME_IN_USE
2981
2982         "Nickname already exists".  Nickname created could not be 
2983         registered because number of same nicknames were already set to
2984         maximum.  This is not expected to happen in real life but is
2985         possible to occur.
2986
2987    25   SILC_STATUS_ERR_NOT_ON_CHANNEL
2988
2989         "You are not on that channel".  The command were specified for
2990         client user is not currently on.
2991
2992    26   SILC_STATUS_ERR_USER_ON_CHANNEL
2993
2994         "User already on channel".  User were invited on channel they
2995         already are on.
2996
2997    27   SILC_STATUS_ERR_NOT_REGISTERED
2998
2999         "You have not registered".  User executed command that requires
3000         the client to be registered on the server before it may be
3001         executed.
3002
3003    28   SILC_STATUS_ERR_NOT_ENOUGH_PARAMS
3004
3005         "Not enough parameters".  Command requires more parameters
3006         than provided.
3007
3008    29   SILC_STATUS_ERR_TOO_MANY_PARAMS
3009
3010         "Too many parameters".  Too many parameters were provided
3011         for the command.
3012
3013    30   SILC_STATUS_ERR_PERM_DENIED
3014
3015         "Your host is not among the privileged".  The client tried to
3016         register on server that does not allow this host to connect.
3017
3018    31   SILC_STATUS_ERR_BANNED_FROM_SERVER
3019
3020         "You are banned from this server".  The client tried to register
3021         on server that has explicitly denied this host to connect.
3022
3023
3024
3025    32   SILC_STATUS_ERR_BAD_PASSWORD
3026
3027         "Cannot join channel. Incorrect password".  Password provided for 
3028         channel were not accepted.
3029
3030    33   SILC_STATUS_ERR_CHANNEL_IS_FULL
3031
3032         "Cannot join channel. Channel is full".  The channel is full
3033         and client cannot be joined to it.
3034
3035    34   SILC_STATUS_ERR_NOT_INVITED
3036
3037         "Cannot join channel. You have not been invited".  The channel
3038         is invite only channel and client has not been invited.
3039
3040    35   SILC_STATUS_ERR_BANNED_FROM_CHANNEL
3041
3042         "Cannot join channel. You have been banned".  The client has
3043         been banned from the channel.
3044
3045    36   SILC_STATUS_ERR_UNKNOWN_MODE
3046
3047         "Unknown mode".  Mode provided by the client were unknown to
3048         the server.
3049
3050    37   SILC_STATUS_ERR_NOT_YOU
3051
3052         "Cannot change mode for other users".  User tried to change
3053         someone else's mode.
3054
3055    38   SILC_STATUS_ERR_NO_CHANNEL_PRIV
3056
3057         "Permission denied. You are not channel operator".  Command may 
3058         be executed only by channel operator.
3059
3060    39   SILC_STATUS_ERR_NO_SERVER_PRIV
3061
3062         "Permission denied. You are not server operator".  Command may
3063         be executed only by server operator.
3064
3065    40   SILC_STATUS_ERR_NO_ROUTER_PRIV
3066
3067         "Permission denied. You are not SILC operator".  Command may be
3068         executed only by router (SILC) operator.
3069
3070    41   SILC_STATUS_ERR_BAD_NICKNAME
3071
3072         "Bad nickname".  Nickname requested contained illegal characters
3073         or were malformed.
3074
3075    42   SILC_STATUS_ERR_BAD_CHANNEL
3076
3077         "Bad channel name".  Channel requested contained illegal characters
3078         or were malformed.
3079
3080    43   SILC_STATUS_ERR_AUTH_FAILED
3081
3082         "Authentication failed".  The authentication data sent as 
3083         argument were wrong and thus authentication failed.
3084 .in 3
3085
3086
3087 .ti 0
3088 6 Security Considerations
3089
3090 Security is central to the design of this protocol, and these security
3091 considerations permeate the specification.
3092
3093
3094 .ti 0
3095 7 References
3096
3097 [SILC2]      Riikonen, P., "SILC Packet Protocol", Internet Draft,
3098              June 2000.
3099
3100 [SILC3]      Riikonen, P., "SILC Key Exchange and Authentication 
3101              Protocols", Internet Draft, June 2000.
3102
3103 [IRC]        Oikarinen, J., and Reed D., "Internet Relay Chat Protocol",
3104              RFC 1459, May 1993.
3105
3106 [SSH-TRANS]  Ylonen, T., et al, "SSH Transport Layer Protocol", 
3107              Internet Draft.
3108
3109 [PGP]        Callas, J., et al, "OpenPGP Message Format", RFC 2440,
3110              November 1998.
3111
3112 [SPKI]       Ellison C., et al, "SPKI Certificate Theory", RFC 2693,
3113              September 1999.
3114
3115 [PKIX-Part1] Housley, R., et al, "Internet X.509 Public Key 
3116              Infrastructure, Certificate and CRL Profile", RFC 2459,
3117              January 1999.
3118
3119 [Schneier]   Schneier, B., "Applied Cryptography Second Edition",
3120              John Wiley & Sons, New York, NY, 1996.
3121
3122 [Menezes]    Menezes, A., et al, "Handbook of Applied Cryptography",
3123              CRC Press 1997.
3124
3125 [OAKLEY]     Orman, H., "The OAKLEY Key Determination Protocol",
3126              RFC 2412, November 1998.
3127
3128 [ISAKMP]     Maughan D., et al, "Internet Security Association and
3129              Key Management Protocol (ISAKMP)", RFC 2408, November
3130              1998.
3131
3132 [IKE]        Harkins D., and Carrel D., "The Internet Key Exchange
3133              (IKE)", RFC 2409, November 1998.
3134
3135 [HMAC]       Krawczyk, H., "HMAC: Keyed-Hashing for Message
3136              Authentication", RFC 2104, February 1997.
3137
3138
3139
3140 .ti 0
3141 8 Author's Address
3142
3143 .nf
3144 Pekka Riikonen
3145 Kasarmikatu 11 A4
3146 70110 Kuopio
3147 Finland
3148
3149 EMail: priikone@poseidon.pspt.fi
3150
3151 This Internet-Draft expires 6 Jun 2001