1 TODO for 1.2 And Beyond
2 =======================
4 NOTE: Any item that doesn't have (***DONE) in it, isn't done yet. The
5 (***TESTING NEEDED) means that the item has been done but not yet properly
8 NOTE: A TODO entry does not mean that it is ever going to be done. Some
9 of the entries may be just ideas, good, bad or ugly. If you want to work
10 on some of the TODO entries simply let us know about it by dropping a note
11 to silc-devel mailing list or appear on 'silc' channel on SILCNet.
17 o Create apps/tutorial containing various Toolkit API tutorials.
19 o The Toolkit split. The Toolkit is to be splitted in parts. How many
20 parts and what the parts are isn't decided yet. Each part is a separate
21 software package. Current thinking is of the following:
23 SILC Toolkit SILC protocol, client and server library
24 SILC Runtime Toolkit runtime library
25 SILC Crypto Toolkit crypto, asn1, math, skr, pgp, etc.
27 The rationale for this is of course that other than SILC projects
28 might like to use the various libraries SILC Toolkit provides, but
29 naturally they don't want the bloat of SILC protocol related stuff.
31 The Runtime library in SILC Toolkit is a general purpose runtime library,
32 like Glib and APR are. The runtime library is to be developed further
33 to provide alternative to Glib and APR.
35 The Crypto library in SILC Toolkit is a general purpose crypto library
36 providing pretty nice APIs compared to many other crypto libraries,
37 especially OpenSSL. The Crypto library is to be developed further
38 to include support for OpenPGP, X.509 and SSH2.
44 o SILC_PACKET_FLAG_ACK support. Implement ACK packet and packet payload
47 o All payload encoding routines should take SilcStack as argument.
49 o Remove SilcCommandCb from silccommand.h.
51 o All payload test routines into lib/silccore/tests/.
54 lib/silcclient, The Client Library
55 ==================================
57 o Giving WHOIS for nick that doesn't exist should remove any same
58 named entries from the client cache.
60 o peer-to-peer private messages
62 o Private message key request notification to application. See XXX in
65 o in JOIN notify handle resolving that timedout. Currently the user is
66 never joined the channel if this happens. What to do if message is
67 received from user that hasn't been resolved/joined?
69 o Message ACKing support.
71 o in /cmode and /cumode with +r, maybe the public key and private key
72 could be just some "string", which would then match to "string.pub" and
75 o If the SILC Events (see below) are implemented, perhaps client library
76 should provide events so that application developer has a choice of
77 developing the SILC app with callbacks or with events.
80 Runtime library, lib/silcutil/
81 ==============================
83 o Fix universal time decoding (doesn't accept all formats) in silctime.c.
85 o Add functions to manipulate environment variables.
87 SilcBool silc_setenv(const char *variable, const char *value);
88 const char *silc_getenv(const char *variable);
89 SilcBool silc_clearenv(const char *variable);
91 o Add functions to loading shared/dynamic object symbols (replaces the
92 SIM library (lib/silcsim) and introduces generic library). Add this
93 to lib/silcutil/silcdll.[ch].
95 SilcDll silc_dll_load(const char *object_path, SilcDllFlags flags);
96 void silc_dll_close(SilcDll dll);
97 void *silc_dll_getsym(SilcDll dll, const char *symbol);
98 const char *silc_dll_error(SilcDll dll);
100 o Add directory opening/traversing functions
102 o silc_getopt routines
104 o The SILC Event signals. Asynchronous events that can be created,
105 connected to and signalled. Either own event routines or glued into
108 SilcTask silc_schedule_task_add_event(SilcSchedule schedule,
109 const char *event, ...);
110 SilcBool silc_schedule_event_connect(SilcSchedule schedule,
112 SilcTaskCallback event_callback,
114 SilcBool silc_schedule_event_signal(SilcSchedule schedule,
115 const char *event, ...);
118 silc_schedule_task_add_event(schedule, "connected",
122 silc_schedule_event_connect(schedule, "connected", connected_cb, ctx);
123 silc_schedule_event_signal(schedule, "connected", integer, buf,
125 SILC_TASK_CALLBACK(connected_cb)
127 FooCtx ctx = context;
132 va_start(args, context);
133 integer = va_arg(args, SilcUInt32);
134 buf = va_arg(args, SilcBuffer);
139 Problems: Events would be SilcSchedule specific, and would not work on
140 multi-thread/multi-scheduler system. The events should be copyable
141 between schedulers. Another problem is the signal delivery. Do we
142 deliver them synchronously possibly from any thread to any other thread
143 or do we deliver them through the target schedulers. If we use the
144 schedulers then signalling would be asynchronous (data must be
145 duplicated and later freed) which is not very nice.
147 o If the event signals are added, the SILC_PARAM_* stuff needs to be
148 moved from silcbuffmt.h to silctypes.h or something similar.
150 o In case the SILC Events are done we shall create a new concept of
151 parent and child SilcSchedule's. When new SilcSchedule is created a
152 parent can be associated to it. This association could be done either
153 directly by the parent or by any other children. This way the signals
154 would in effect be global and would reach all children schedulers.
156 This relationship would be associative only. The schedulers are still
157 independent and run independently from each other. All schedulers
158 would be linked and could be accessed from any of the schedulers.
159 It should be possible to retrieve the parent and enumate all children
160 from any of the schedulers.
162 SilcSchedule silc_schedule_init(int max_tasks, void *app_context,
163 SilcSchedule parent);
164 SilcSchedule silc_schedule_get_parent(SilcSchedule schedule);
166 o Additional scheduler changes: optimize silc_schedule_wakeup. Wakeup
167 only if the scheduler is actually waiting something. If it is
168 delivering tasks wakeup is not needed.
170 o Structured log messages to Log API. Allows machine readable log
171 messages. Would allow sending of any kind of data in a log message.
173 o Base64 to an own API
177 o Add builtin SOCKS and HTTP Proxy support, well the SOCKS at least.
178 SILC currently supports SOCKS4 and SOCKS5 but it needs to be compiled
181 o silc_stringprep to non-allocating version.
183 o silc_hash_table_replace -> silc_hash_table_set. Retain support for
184 silc_hash_table_replace as macro.
186 o SilcStack aware SilcHashTable.
188 o SilcStack aware SilcDList.
190 o Thread pool API. Add this to lib/silcutil/silcthread.[ch]. (***DONE)
192 o Fast mutex implementation. Fast rwlock implementation. Mutex and
193 rwlock implementation using atomic operations.
195 o Compression routines are missing. The protocol supports packet
196 compression thus it must be implemented. SILC Zip API must be
199 o Add new functions to SilcStack API in lib/silcutil/silcstack.[ch]. Add
200 silc_stack_[set|get]_alignment. It defines the default alignment used
201 when allocating memory from stack. It can be used to specify special
202 alignments too when needed (such as for hardware devices like crypto
203 accelerators). Move also the low level silc_stack_malloc and
204 silc_stack_realloc from silcstack_i.h to silcstack.h. Remove the
205 _ua unaligned memory allocation routines. Remove unaligned memory
206 allocation possibility. (***DONE)
208 o Add '%@' format to silc_snprintf functions. It marks for external
209 rendering function of following type:
211 /* Snprintf rendering function. The `data' is rendered into a string
212 and allocated string is returned. If NULL is returned the
213 rendering is skipped and ignored. If the returned string does
214 not fit to the destination buffer it may be truncated. */
215 typedef char *(*SilcSnprintfRender)(void *data);
217 It can work like following:
219 char *id_renderer(void *data)
222 id_to_str(tmp, sizeof(tmp), (SilcID *)data);
226 silc_snprintf(buf, sizeof(buf), "Client ID %@", id_renderer, client_id);
228 (o Generic SilcStatus or SilcResult that includes all possible status and
229 error conditions, including those of SILC protocol. Though, the SILC
230 protocol related status (currently in silcstatus.h) cannot be in
231 runtime library) maybe
233 (o SILC specific socket creation/closing routines to silcnet.h, wrappers
234 to all send(), recv(), sendto() etc. Bad thing is that we'd have to
235 define all socket options, sockaddrs, etc.) maybe
240 lib/silcutil/symbian/
241 =====================
243 o Something needs to be thought to the logging globals as well,
244 like silc_debug etc. They won't work on EPOC. Perhaps logging
245 and debugging is to be disabled on EPOC. The logging currently works
246 by it cannot be controlled, same with debugging.
249 SFTP Library, lib/silcsftp/
250 ===========================
252 o Read prefetch (read-ahead, reading ahead of time). Maybe if this can
256 SKR Library, lib/silcskr/
257 =========================
259 o Add fingerprint as search constraint.
261 o Add OpenPGP support. Adding, removing, fetching PGP keys. (Keyring
264 o Add support for importing public keys from a directory and/or from a
265 file. Add support for exporting the repository (different formats for
266 different key types?).
268 o Change the entire silc_skr_find API. Remove SilcSKRFind and just simply
269 add the find constraints as variable argument list to silc_skr_find, eg:
271 silc_skr_find(skr, schedule, callback, context,
272 SILC_SKR_FIND_PUBLIC_KEY, public_key,
273 SILC_SKR_FIND_COUNTRY, "FI",
274 SILC_SKR_FIND_USAGE, SILC_SKR_USAGE_AUTH,
277 NULL argument would be ignored and skipped.
279 o Add OR logical rule in addition of the current default AND, eg:
281 // Found key(s) MUST have this public key AND this country.
282 silc_skr_find(skr, schedule, callback, context,
283 SILC_SKR_FIND_RULE_AND,
284 SILC_SKR_FIND_PUBLIC_KEY, public_key,
285 SILC_SKR_FIND_COUNTRY, "FI",
288 // Found key(s) MUST have this public key OR this key context
289 silc_skr_find(skr, schedule, callback, context,
290 SILC_SKR_FIND_RULE_OR,
291 SILC_SKR_FIND_PUBLIC_KEY, public_key,
292 SILC_SKR_FIND_CONTEXT, key_context,
295 o SilcStack to SKR API.
298 Crypto Library, lib/silccrypt/
299 ==============================
303 o Add fingerprint to SilcSILCPublicKey and retrieval to silcpk.h, and
304 possibly to silcpkcs.h.
306 /* Return fingerprint of the `public_key'. Returns also the algorithm
307 that has been used to make the fingerprint. */
308 const unsigned char *
309 silc_pkcs_get_fingerprint(SilcPublicKey public_key,
310 const char **hash_algorithm,
311 SilcUInt32 *fingerprint_len);
313 o Change SILC PKCS API to asynchronous, so that accelerators can be used.
314 All PKCS routines should now take callbacks as argument and they should
315 be delivered to SilcPKCSObject and SilcPKCSAlgorithm too.
317 /* Signature computation callback */
318 typedef void (*SilcPKCSSignCb)(SilcBool success,
319 const unsigned char *signature,
320 SilcUInt32 signature_len,
323 /* Signature verification callback */
324 typedef void (*SilcPKCSVerifyCb)(SilcBool success, void *context);
326 /* Encryption callback */
327 typedef void (*SilcPKCSEncryptCb)(SilcBool success,
328 const unsigned char *encrypted,
329 SilcUInt32 encrypted_len,
332 /* Decryption callback */
333 typedef void (*SilcPKCSDecryptCb)(SilcBool success,
334 const unsigned char *decrypted,
335 SilcUInt32 decrypted_len,
338 Either add new _async functions or add the callbacks to existing API
339 and if the callback is NULL then the API is not async and if provided
340 it may be async. For example;
342 SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
343 unsigned char *src, SilcUInt32 src_len,
344 unsigned char *dst, SilcUInt32 dst_size,
346 SilcBool compute_hash, SilcHash hash,
347 SilcPKCSSignCb async_sign,
348 void *async_sign_context);
350 (if this is done then there's no reason why the buffers in the
351 callbacks cannot be the ones user gives here) or allow only async:
353 SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
354 unsigned char *src, SilcUInt32 src_len,
355 SilcBool compute_hash, SilcHash hash,
356 SilcPKCSSignCb async_sign,
357 void *async_sign_context);
361 SilcBool silc_pkcs_sign_async(SilcPrivateKey private_key,
362 unsigned char *src, SilcUInt32 src_len,
363 SilcBool compute_hash, SilcHash hash,
364 SilcPKCSSignCb async_sign,
365 void *async_sign_context);
367 o Change PKCS Algorithm API to take SilcPKCSAlgorithm as argument to
368 encrypt, decrypt, sign and verify functions. We may need to for exmaple
369 check the alg->hash, supported hash functions. Maybe deliver it also
370 to all other functions in SilcPKCSAlgorithm to be consistent.
372 o Add DSS support. Take implementation from Tom or make it yourself.
374 o Implement the defined SilcDH API. The definition is in
375 lib/silccrypt/silcdh.h. Make sure it is asynchronous so that it can
376 be accelerated. Also take into account that it could use elliptic
381 o All cipher, hash, hmac etc. allocation routines should take their name
382 in as const char * not const unsigned char *.
385 SILC Accelerator Library
386 ========================
388 o SILC Accelerator API. Provides generic way to use different kind of
389 accelerators. Basically implements SILC PKCS API so that SilcPublicKey
390 and SilcPrivateKey can be used but they call the accelerators.
392 Something in the lines of (preliminary):
394 /* Register accelerator to system. Initializes the accelerator. */
395 Varargs are optional accelerator specific init parameteres. */
396 SilcBool silc_acc_register(SilcAccelerator acc, ...);
398 silc_acc_register(softacc, "min_threads", 2, "max_threads", 16, NULL);
400 /* Unregister accelerator. Uninitializes the accelerator. */
401 SilcBool silc_acc_unregister(const SilcAccelerator acc);
403 /* Return list of the registered accelerators */
404 SilcDList silc_acc_get_supported(void);
406 /* Find existing accelerator. `name' is accelerator's name. */
407 SilcAccelerator silc_acc_find(const char *name);
409 /* Return accelerator's name */
410 const char *silc_acc_get_name(SilcAccelerator acc);
412 /* Accelerate `public_key'. Return accelerated public key. */
413 SilcPublicKey silc_acc_public_key(SilcAccelerator acc,
414 SilcPublicKey public_key);
416 /* Accelerate `private_key'. Returns accelerated private key. */
417 SilcPrivateKey silc_acc_private_key(SilcAccelerator acc,
418 SilcPrivateKey private_key);
420 /* Return the underlaying public key */
421 SilcPublicKey silc_acc_get_public_key(SilcAccelerator acc,
422 SilcPublicKey public_key);
424 /* Return the underlaying private key */
425 SilcPrivateKey silc_acc_get_private_key(SilcAccelerator acc,
426 SilcPrivateKey private_key);
428 typedef struct SilcAcceleratorObject {
429 const char *name; /* Accelerator's name */
430 SilcBool (*init)(va_list va); /* Initialize accelerator */
431 SilcBool (*uninit)(void); /* Uninitialize accelerator */
432 const SilcPKCSAlgorithm *pkcs; /* Accelerated PKCS algorithms */
433 const SilcDHObject *dh; /* Accelerated Diffie-Hellmans */
434 const SilcCipherObject *cipher; /* Accelerated ciphers */
435 const SilcHashObject *hash; /* Accelerated hashes */
436 const SilcHmacObject *hmac; /* Accelerated HMACs */
437 const SilcRngObject *rng; /* Accelerated RNG's */
438 } *SilcAccelerator, SilcAcceleratorStruct;
440 Allows accelerator to have multiple accelerators (cipher, hash etc)
441 and multiple different algorithms and implementations (SHA-1, SHA-256 etc).
443 SilcPublicKey->SilcSILCPublicKey->RsaPublicKey accelerated as:
444 SilcPublicKey->SilcAcceleratorPublicKey->SilcSoftAccPublicKey->
445 SilcPublicKey->SilcSILCPublicKey->RsaPublicKey
447 silc_acc_public_key creates SilcPublicKey and SilcAcceleratorPublicKey
448 and acc->pkcs->import_public_key creates SilcSoftAccPublicKey.
450 o Implement software accelerator. It is a thread pool system where the
451 public key and private key operations are executed in threads.
453 const struct SilcAcceleratorObject softacc =
455 "softacc", softacc_init, softacc_uninit,
456 softacc_pkcs, NULL, NULL, NULL, NULL
459 /* Called from silc_acc_private_key */
460 int silc_softacc_import_private_key(void *key, SilcUInt32 key_len,
461 void **ret_private_key)
463 SilcSoftAccPrivateKey prv = silc_calloc(1, sizeof(*prv));
464 prv->pkcs = acc->pkcs;
465 prv->private_key = key;
466 *ret_private_key = prv;
469 (o Symmetric key cryptosystem acceleration? They are always sycnhronouos
470 even with hardware acceleration so the crypto API shouldn't require
477 o Import TFM. Talk to Tom to add the missing functions. Use TFM in
478 client and client library, but TMA in server, due to the significantly
479 increased memory consumption with TFM, and the rare need for public
480 key operations in server.
482 We want TFM's speed but not TFM's memory requirements. Talk to Tom
483 about making the TFM mp dynamic just as it is in LTM.
485 o The SILC MP API function must start returning indication of success
486 and failure of the operation.
488 o Do SilcStack support for silc_mp_init, silc_mp_init_size and other
489 any other MP function (including utility ones) that may allocate
492 o All utility functions should be made non-allocating ones.
495 SILC XML Library, lib/silcxml/
496 ==============================
498 o SILC XML API (wrapper to expat). Look at the expat API and simplify
499 it. The SILC XML API should have at most 8-10 API functions. It should
500 be possible to create full XML parser with only one function. And, it
501 should be possible to have a function that is able to parse an entire
502 XML document. It should also have a parser function to be able to
503 parse a stream of XML data (SilcStream). It MUST NOT have operations
504 that require multiple function calls to be able to execute that one
505 operation (like creating parser).
508 lib/silcske/silcske.[ch]
509 ========================
511 o Ratelimit to UDP/IP transport for incoming packets.
517 o Negative integer encoding is missing, add it.
519 o SILC_ASN1_CHOICE should perhaps return an index what choice in the
520 choice list was found. Currently it is left for caller to figure out
521 which choice was found.
523 o SILC_ASN1_NULL in decoding should return SilcBool whether or not
524 the NULL was present. It's important when it's SILC_ASN1_OPTIONAL
525 and we need to know whether it was present or not.
531 o OpenPGP certificate support, allowing the use of PGP public keys
538 o SSH2 public key/private key support, allowing the use of SSH2 keys
545 o PKIX implementation
551 o Deprecate the old server. Write interface for the new lib/silcserver
552 server library. The interface should work on Unix/Linux systems.
554 o Consider deprecating also the old config file format and use XML
555 istead. This should require SILC XML API implementation first.
557 o The configuration must support dynamic router and server connections.
558 The silcd must work without specifying any servers or routers to
561 o The configuration must support specifying whether the server is
562 SILC Server or SILC Router. This should not be deduced from the
563 configuration as it was in < 1.2.
565 o The configuration must support specifying the ciphers and hmacs and
566 their order so that user can specify which algorithms take preference.
572 o Rewrite the entire server. Deprecate apps/silcd as the main server
573 implementation and create lib/silcserver/. It is a platform
574 independent server library. The apps/silcd will merely provide a
575 a simple interface for the library.
577 o Write the SILC Server library extensively using SILC FSM.
579 o Server library must support multiple networks. This means that one
580 server must be able to create multiple connections that each reach
581 different SILC network. This means also that all cache's etc. must
582 be either connection-specific or network-specific.
584 o Library must support dynamic router and server connections. This means
585 that connections are create only when they are needed, like when someone
586 says JOIN foo@foo.bar.com or WHOIS foobar@silcnet.org.
588 o Library must support server-to-server connections even though protocol
589 prohibits that. The responder of the connection should automatically
590 act as a router. The two servers create an own, isolated, SILC network.
591 To be used specifically with dynamic connections.
593 o Library must support multiple threads and must be entirely thread safe.
595 o Library must have support for SERVICE command.
597 o The server must be able to run behind NAT device. This means that
598 Server ID must be based on public IP instead of private IP.
600 o The following data must be in per-connection context: client id cache,
601 server id cache, channel id cache, all statistics must be
604 o The following data must be in per-thread context: command context
605 freelist/pool, pending commands, random number generator.
607 o Do inccoming packet processing in an own FSM thread in the
608 server-threads FSM. Same as in client library.
610 o Reference count all Silc*Entry structures.
612 Some issues that must be kept in mind from 1.0 and 1.1 silcd's:
614 o The SERVER_SIGNOFF notify handing is not optimal, because it'll
615 cause sending of multiple SIGNOFF notify's instead of the one
616 SERVER_SIGNOFF notify that the server received. This should be
617 optimized so that the only SERVER_SIGNOFF is sent and not
618 SIGNOFF of notify at all (using SIGNOFF takes the idea about
619 SERVER_SIGNOFF away entirely).
621 o Another SERVER_SIGNOFF opt/bugfix: Currently the signoff is
622 sent to a client if it is on same channel as the client that
623 signoffed. However, the entire SERVER_SIGNOFF list is sent to
624 the client, ie. it may receive clients that was not on the
625 same channel. This is actually against the specs. It must be
626 done per channel. It shouldn't receive the whole list just
627 because one client happened to be on same channel.
629 o If client's public key is saved in the server (and doing public key
630 authentication) then the hostname and the username information could
631 be taken from the public key. Should be a configuration option!
633 o Add a timeout to handling incoming JOIN commands. It should be
634 enforced that JOIN command is executed only once in a second or two
635 seconds. Now it is possible to accept n incoming JOIN commands
636 and process them without any timeouts. THis must be employed because
637 each JOIN command will create and distribute the new channel key
638 to everybody on the channel.
640 o Related to above. If multiple JOINs are received in sequence perhaps
641 new key should be created only once, if the JOINs are handeled at the same
642 time. Now we create multiple keys and never end up using them because
643 many JOINs are processed at the same time in sequence. Only the last
644 key ends up being used.