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