updates.
[silc.git] / TODO
1 TODO for 1.2 And Beyond
2 =======================
3
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
6 tested.
7
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.
12
13
14 General
15 =======
16
17  o Create apps/tutorial containing various Toolkit API tutorials.
18
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:
22
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.
26
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.
30
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.
34
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.
39
40
41 lib/silccore
42 ============
43
44  o SILC_PACKET_FLAG_ACK support.  Implement ACK packet and packet payload
45    to silcpacket.c.
46
47  o All payload encoding routines should take SilcStack as argument.
48
49  o All payload test routines into lib/silccore/tests/.
50
51
52 lib/silcclient, The Client Library
53 ==================================
54
55  o peer-to-peer private messages
56
57  o Private message key request notification to application.  See XXX in
58    client_prvmsg.c.
59
60  o in JOIN notify handle resolving that timedout.  Currently the user is
61    never joined the channel if this happens.  What to do if message is
62    received from user that hasn't been resolved/joined?
63
64  o Message ACKing support.
65
66  o in /cmode and /cumode with +r, maybe the public key and private key
67    could be just some "string", which would then match to "string.pub" and
68    "string.prv".
69
70
71 Runtime library, lib/silcutil/
72 ==============================
73
74  o Fix universal time decoding (doesn't accept all formats) in silctime.c.
75
76  o Add functions to manipulate environment variables.
77
78    SilcBool silc_setenv(const char *variable, const char *value);
79    const char *silc_getenv(const char *variable);
80    SilcBool silc_clearenv(const char *variable);
81
82  o Add functions to loading shared/dynamic object symbols (replaces the
83    SIM library (lib/silcsim) and introduces generic library).
84
85    SilcDll silc_dll_load(const char *object_path, SilcDllFlags flags);
86    void silc_dll_close(SilcDll dll);
87    void *silc_dll_getsym(SilcDll dll, const char *symbol);
88    const char *silc_dll_error(SilcDll dll);
89
90  o Add directory opening/traversing functions
91
92  o silc_getopt routines
93
94  o silc_hash_table_replace -> silc_hash_table_set.  Retain support for
95    silc_hash_table_replace as macro.
96
97  o The SILC Event signals.  Asynchronous events that can be created,
98    connected to and signalled.  Either own event routines or glued into
99    SilcSchedule:
100
101    SilcTask silc_schedule_task_add_event(SilcSchedule schedule,
102                                          const char *event, ...);
103    SilcBool silc_schedule_event_connect(SilcSchedule schedule,
104                                         const char *event,
105                                         SilcTaskCallback event_callback,
106                                         void *context);
107    SilcBool silc_schedule_event_signal(SilcSchedule schedule,
108                                        const char *event, ...);
109
110    Example:
111      silc_schedule_task_add_event(schedule, "connected",
112                                   SILC_PARAM_UI32_INT,
113                                   SILC_PARAM_BUFFER,
114                                   SILC_PARAM_END);
115      silc_schedule_event_connect(schedule, "connected", connected_cb, ctx);
116      silc_schedule_event_signal(schedule, "connected", integer, buf,
117                                  SILC_PARAM_END);
118      SILC_TASK_CALLBACK(connected_cb)
119      {
120        FooCtx ctx = context;
121        va_list args;
122        SilcUInt32 integer;
123        SilcBuffer buf;
124  
125        va_start(args, context);
126        integer = va_arg(args, SilcUInt32);
127        buf = va_arg(args, SilcBuffer);
128        va_end(args);
129        ...
130      }
131
132    Problems: Events would be SilcSchedule specific, and would not work on 
133    multi-thread/multi-scheduler system.  The events should be copyable 
134    between schedulers.
135
136  o Structured log messages to Log API.  Allows machine readable log
137    messages.  Would allow sending of any kind of data in a log message.
138
139  o Base64 to an own API
140
141  o Timer API
142
143  o Add builtin SOCKS and HTTP Proxy support, well the SOCKS at least.
144    SILC currently supports SOCKS4 and SOCKS5 but it needs to be compiled
145    in separately.
146
147  o silc_stringprep to non-allocating version.
148
149  o SilcStack aware SilcHashTable.
150
151  o SilcStack aware SilcDList.
152
153  o Thread pool API.
154
155    typedef void (*SilcThreadPoolFunc)(SilcSchedule schedule,
156                                       void *context);
157
158    /* Allocate thread pool with at least `min_threads' and at most
159       `max_threads' many threads.  If `stack' is non-NULL all memory
160       is allocated from the `stack'.  If `start_min_threads' is TRUE
161       this will start `min_threads' many threads immediately. */
162    SilcThreadPool silc_thread_pool_alloc(SilcStack stack,
163                                          SilcUInt32 min_threads,
164                                          SilcUInt32 max_threads,
165                                          SilcBool start_min_threads);
166
167    /* Free thread pool.  If `wait_unfinished' is TRUE this will block
168       and waits that all remaining active threads finish before freeing
169       the pool. */
170    void silc_thread_pool_free(SilcThreadPool tp, SilcBool wait_unfinished);
171
172    /* Run `run' function with `run_context' in one of the threads in the
173       thread pool.  Returns FALSE if the thread pool is being freed.  If
174       there are no free threads left in the pool this will queue the
175       the `run' and will call it once a thread becomes free.
176
177       If `completion' is non-NULL it will be called to indicate completion
178       of the `run' function.  If `schedule' is non-NULL the `completion'
179       will be called through the scheduler in the main thread.  If it is
180       NULL the `completion' is called directly from the thread after the
181       `run' has returned. */
182    SilcBool silc_thread_pool_run(SilcThreadPool tp,
183                                  SilcSchedule schedule,
184                                  SilcThreadPoolFunc run,
185                                  void *run_context,
186                                  SilcThreadPoolFunc completion,
187                                  void *completion_context);
188
189    /* Modify the amount of maximum threads of the pool. */
190    void silc_thread_pool_set_max_threads(SilcThreadPool tp,
191                                          SilcUInt32 max_threads);
192
193    /* Returns the amount of maximum size the pool can grow. */
194    SilcUInt32 silc_thread_pool_get_max_threads(SilcThreadPool tp);
195
196    /* Returns the amount of free threads in the pool currently. */
197    SilcUInt32 silc_thread_pool_get_free_threads(SilcThreadPool tp);
198
199    /* Stops all free and started threads.  The minumum amount of threads
200       specified to silc_thread_pool_alloc always remains. */
201    void silc_thread_pool_stop_free_threads(SilcThreadPool tp);
202
203  o Compression routines are missing.  The protocol supports packet
204    compression thus it must be implemented.  SILC Zip API must be
205    defined.
206
207  (o Generic SilcStatus or SilcResult that includes all possible status and 
208     error conditions, including those of SILC protocol.  Though, the SILC
209     protocol related status (currently in silcstatus.h) cannot be in 
210     runtime library) maybe
211
212  (o SILC specific socket creation/closing routines to silcnet.h, wrappers
213   to all send(), recv(), sendto() etc.  Bad thing is that we'd have to
214   define all socket options, sockaddrs, etc.) maybe
215
216  (o mmap) maybe
217
218
219 lib/silcutil/symbian/
220 =====================
221
222  o Something needs to be thought to the logging globals as well,
223    like silc_debug etc.  They won't work on EPOC.  Perhaps logging
224    and debugging is to be disabled on EPOC.  The logging currently works
225    by it cannot be controlled, same with debugging.
226
227
228 SFTP Library, lib/silcsftp/
229 ===========================
230
231  o Read prefetch (read-ahead, reading ahead of time).  Maybe if this can
232    be done easily.
233
234
235 SKR Library, lib/silcskr/
236 =========================
237
238  o Add fingerprint as search constraint.
239
240  o Add OpenPGP support.  Adding, removing, fetching PGP keys.  (Keyring
241    support?)
242
243  o Add support for importing public keys from a directory and/or from a
244    file.  Add support for exporting the repository (different formats for
245    different key types?).
246
247  o Change the entire silc_skr_find API.  Remove SilcSKRFind and just simply
248    add the find constraints as variable argument list to silc_skr_find, eg:
249
250   silc_skr_find(skr, schedule, callback, context,
251                 SILC_SKR_FIND_PUBLIC_KEY, public_key,
252                 SILC_SKR_FIND_COUNTRY, "FI",
253                 SILC_SKR_FIND_USAGE, SILC_SKR_USAGE_AUTH,
254                 SILC_SKR_FIND_END);
255
256    NULL argument would be ignored and skipped.
257
258  o Add OR logical rule in addition of the current default AND, eg:
259
260   // Found key(s) MUST have this public key AND this country.
261   silc_skr_find(skr, schedule, callback, context,
262                 SILC_SKR_FIND_RULE_AND,
263                 SILC_SKR_FIND_PUBLIC_KEY, public_key,
264                 SILC_SKR_FIND_COUNTRY, "FI",
265                 SILC_SKR_FIND_END);
266
267   // Found key(s) MUST have this public key OR this key context
268   silc_skr_find(skr, schedule, callback, context,
269                 SILC_SKR_FIND_RULE_OR,
270                 SILC_SKR_FIND_PUBLIC_KEY, public_key,
271                 SILC_SKR_FIND_CONTEXT, key_context,
272                 SILC_SKR_FIND_END);
273
274
275 Crypto Library, lib/silccrypt/
276 ==============================
277
278  o Add fingerprint to SilcSILCPublicKey and retrieval to silcpk.h, and
279    possibly to silcpkcs.h.
280
281    /* Return fingerprint of the `public_key'.  Returns also the algorithm
282       that has been used to make the fingerprint. */
283    const unsigned char *
284    silc_pkcs_get_fingerprint(SilcPublicKey public_key,
285                              const char **hash_algorithm,
286                              SilcUInt32 *fingerprint_len);
287
288  o Change SILC PKCS API to asynchronous, so that accelerators can be used.
289    All PKCS routines should now take callbacks as argument and they should
290    be delivered to SilcPKCSObject and SilcPKCSAlgorithm too.
291
292    /* Signature computation callback */
293    typedef void (*SilcPKCSSignCb)(SilcBool success,
294                                   const unsigned char *signature,
295                                   SilcUInt32 signature_len,
296                                   void *context);
297
298    /* Signature verification callback */
299    typedef void (*SilcPKCSVerifyCb)(SilcBool success, void *context);
300
301    /* Encryption callback */
302    typedef void (*SilcPKCSEncryptCb)(SilcBool success,
303                                      const unsigned char *encrypted,
304                                      SilcUInt32 encrypted_len,
305                                      void *context);
306
307    /* Decryption callback */
308    typedef void (*SilcPKCSDecryptCb)(SilcBool success,
309                                      const unsigned char *decrypted,
310                                      SilcUInt32 decrypted_len,
311                                      void *context);
312
313    Either add new _async functions or add the callbacks to existing API
314    and if the callback is NULL then the API is not async and if provided
315    it may be async.  For example;
316
317    SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
318                            unsigned char *src, SilcUInt32 src_len,
319                            unsigned char *dst, SilcUInt32 dst_size,
320                            SilcUInt32 *dst_len,
321                            SilcBool compute_hash, SilcHash hash,
322                            SilcPKCSSignCb async_sign,
323                            void *async_sign_context);
324
325    (if this is done then there's no reason why the buffers in the 
326     callbacks cannot be the ones user gives here) or allow only async:
327
328    SilcBool silc_pkcs_sign(SilcPrivateKey private_key,
329                            unsigned char *src, SilcUInt32 src_len,
330                            SilcBool compute_hash, SilcHash hash,
331                            SilcPKCSSignCb async_sign,
332                            void *async_sign_context);
333
334    or add new:
335
336    SilcBool silc_pkcs_sign_async(SilcPrivateKey private_key,
337                                  unsigned char *src, SilcUInt32 src_len,
338                                  SilcBool compute_hash, SilcHash hash,
339                                  SilcPKCSSignCb async_sign,
340                                  void *async_sign_context);
341
342  o Change PKCS Algorithm API to take SilcPKCSAlgorithm as argument to
343    encrypt, decrypt, sign and verify functions.  We may need to for exmaple
344    check the alg->hash, supported hash functions.  Maybe deliver it also
345    to all other functions in SilcPKCSAlgorithm to be consistent.
346
347  o Add DSS support.  Take implementation from Tom or make it yourself.
348
349  o Implement the defined SilcDH API.  The definition is in
350    lib/silccrypt/silcdh.h.
351
352  o All cipher, hash, hmac etc. allocation routines should take their name
353    in as const char * not const unsigned char *.
354
355  o ECDSA and ECDH
356
357
358 SILC Accelerator Library
359 ========================
360
361  o SILC Accelerator API.  Provides generic way to use different kind of
362    accelerators.  Basically implements SILC PKCS API so that SilcPublicKey
363    and SilcPrivateKey can be used but they call the accelerators.
364
365    Something in the lines of (preliminary):
366
367    /* Register accelerator to system */
368    SilcBool silc_acc_register(const SilcAccelerator acc);
369
370    /* Unregister accelerator */
371    SilcBool silc_acc_unregister(const SilcAccelerator acc);
372
373    /* Find existing accelerator.  `name' is accelerators name and
374       `params' is optional accelerator specific parameters. */
375    SilcAccelerator silc_acc_find(const char *name, const char *params);
376
377    /* Return accelerator's displayable name */
378    const char *silc_ac_get_display_name(SilcAccelerator acc);
379
380    /* Accelerate `public_key'.  Return accelerated public key. */
381    SilcPublicKey silc_acc_public_key(SilcAccelerator acc,
382                                      SilcPublicKey public_key);
383
384    /* Accelerate `private_key'.  Returns accelerated private key. */
385    SilcPrivateKey silc_acc_private_key(SilcAccelerator acc,
386                                        SilcPrivateKey private_key);
387
388    /* Return the underlaying public key */
389    SilcPublicKey silc_acc_get_public_key(SilcAccelerator acc,
390                                          SilcPublicKey public_key);
391
392    /* Return the underlaying private key */
393    SilcPrivateKey silc_acc_get_private_key(SilcAccelerator acc,
394                                            SilcPrivateKey private_key);
395
396    typedef struct SilcAcceleratorObject {
397      const char *name;                          /* Accelerator's name */
398      const char *display_name;                  /* Displayable name */
399      SilcAcceleratorType type;                  /* Accelerator type */
400      union {
401        struct {
402          SilcPKCSObject *pkcs;                  /* PKCS, may be NULL */
403          SilcPKCSAlgorithm *algorithm;          /* Accelerator */
404        } pkcs;
405
406        struct {
407
408        } cipher;
409      } u;
410    } *SilcAccelerator, SilcAcceleratorStruct;
411
412    SilcPublicKey->SilcSILCPublicKey->RsaPublicKey accelerated as:
413    SilcPublicKey->SilcSILCPublicKey->SilcAcceleratorSoftware->RsaPublicKey or
414    SilcPublicKey->SilcSILCPublicKey->SilcAcceleratorPublicKey->
415      SilcAcceleratorSoftware->RsaPublicKey 
416
417    The former one if u.pkcs.pkcs == NULL.
418
419  o Implement software accelerator.  It is a thread pool system where the
420    public key and private key operations are executed in threads.
421
422    This implements SilcPKCSAlgorithm (and SilcPKCSObject if needed) that 
423    implements the thread acclerated system.
424
425  (o Symmetric key cryptosystem acceleration?  They are always sycnhronouos
426    even with hardware acceleration so the crypto API shouldn't require
427    changes.) maybe
428
429
430 lib/silcmath
431 ============
432
433  o Import TFM.  Talk to Tom to add the missing functions.  Use TFM in
434    client and client library, but TMA in server, due to the significantly
435    increased memory consumption with TFM, and the rare need for public
436    key operations in server.
437
438    We want TFM's speed but not TFM's memory requirements.  Talk to Tom
439    about making the TFM mp dynamic just as it is in LTM.
440
441  o The SILC MP API function must start returning indication of success
442    and failure of the operation.
443
444  o Do SilcStack support for silc_mp_init, silc_mp_init_size and other
445    any other MP function (including utility ones) that may allocate
446    memory.
447
448  o All utility functions should be made non-allocating ones.
449
450
451 SILC XML Library, lib/silcxml/
452 ==============================
453
454  o SILC XML API (wrapper to expat).  The SILC XML API should follow and 
455    resemble Simple API for XML (SAX).
456
457
458 lib/silcske/silcske.[ch]
459 ========================
460
461  o Ratelimit to UDP/IP transport for incoming packets.
462
463
464 lib/silcasn1
465 ============
466
467  o Negative integer encoding is missing, add it.
468
469  o SILC_ASN1_CHOICE should perhaps return an index what choice in the
470    choice list was found.  Currently it is left for caller to figure out
471    which choice was found.
472
473  o SILC_ASN1_NULL in decoding should return SilcBool whether or not
474    the NULL was present.  It's important when it's SILC_ASN1_OPTIONAL
475    and we need to know whether it was present or not.
476
477
478 lib/silcpgp
479 ===========
480
481  o OpenPGP certificate support, allowing the use of PGP public keys
482    in SILC.
483
484
485 lib/silcssh
486 ===========
487
488  o SSH2 public key/private key support, allowing the use of SSH2 keys
489    in SILC.  RFC 4716.
490
491
492 lib/silcpkix
493 ============
494
495  o PKIX implementation
496
497
498 lib/silcserver
499 ==============
500
501  o (Re)write commands/command replys.
502
503  o (Re)write notify handling.
504
505  o The SERVER_SIGNOFF notify handing is not optimal, because it'll
506    cause sending of multiple SIGNOFF notify's instead of the one
507    SERVER_SIGNOFF notify that the server received.  This should be
508    optimized so that the only SERVER_SIGNOFF is sent and not
509    SIGNOFF of notify at all (using SIGNOFF takes the idea about
510    SERVER_SIGNOFF away entirely).
511
512  o Another SERVER_SIGNOFF opt/bugfix:  Currently the signoff is
513    sent to a client if it is on same channel as the client that
514    signoffed.  However, the entire SERVER_SIGNOFF list is sent to
515    the client, ie. it may receive clients that was not on the
516    same channel.  This is actually against the specs.  It must be
517    done per channel.  It shouldn't receive the whole list just
518    because one client happened to be on same channel.
519
520  o Add reference counters to all Silc*Entry structures
521
522  o SERVICEs support (plugin, SIM)
523
524  o If client's public key is saved in the server (and doing public key
525    authentication) then the hostname and the username information could
526    be taken from the public key.  Should be a configuration option!
527
528  o Add a timeout to handling incoming JOIN commands.  It should be
529    enforced that JOIN command is executed only once in a second or two
530    seconds.  Now it is possible to accept n incoming JOIN commands
531    and process them without any timeouts.  THis must be employed because
532    each JOIN command will create and distribute the new channel key
533    to everybody on the channel.
534
535  o Related to above.  If multiple JOINs are received in sequence perhaps
536    new key should be created only once, if the JOINs are handeled at the same
537    time.  Now we create multiple keys and never end up using them because
538    many JOINs are processed at the same time in sequence.  Only the last
539    key ends up being used.
540
541  o The CMODE cipher & hmac change problem (#101).