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