make it compile on mingw32.
[silc.git] / TODO-1.0
1 TODO After 1.0
2 ==============
3
4 A rough list of stuff that is going to be done to SILC after 1.0 or at
5 least could be done.
6
7  o Implement the defined SilcDH API.  The definition is in
8    lib/silccrypt/silcdh.h.
9
10  o X.509 certificate support.  SILC protocol supports certificates and
11    it would be great to have support for them.  This is a big task as
12    support has to be made for ASN.1 as well.  I've looked into OpenSSL 
13    package as it has X.509 certificate support (and ASN.1 as well).  
14    The code does not look very good to my eye but it has some potentials.
15    This should be looked at more closely.
16
17    Naturally own SILC Certificate API has to be defined regardles what
18    the actual X.509 library is (OpenSSL X.509 or something else).  Other
19    choice is to write own X.509 library but I'm not going to do it - 
20    I can help to migrate the OpenSSL X.509 into SILC and I can help if 
21    someone would like to write the X.509 library - but I'm not going 
22    to start writing one myself.  Anyhow, the OpenSSL X.509 lib should
23    be checked.
24
25    Other package that should be checked is the NSS's X509 library,
26    which I like more over OpenSSL package.
27
28  o SSH2 public keys support, allowing the use of SSH2 public keys in
29    SILC.
30
31  o OpenPGP certificate support, allowing the use of PGP public keys
32    in SILC.
33
34  o Compression routines are missing.  The protocol supports packet
35    compression thus it must be implemented.  SILC Zip API must be
36    defined.
37
38  o Optimizations in Libraries
39
40         o There is currently three (3) allocations per packet in the
41           silc_packet_receive_process, which is used to process and
42           dispatch all packets in the packet queue to the parser callback
43           function.  First allocation is for parse_ctx, second for the
44           SilcPacketContext, and third for packet->buffer where the actual
45           data is saved.
46
47           The parse_ctx allocation can be removed by adding it as a
48           structure to the SilcPacketContext.  When the SilcPacketContext
49           is allocated there is space for the parse context already.
50
51           The silc_packet_context_alloc could have a free list of
52           packet contexts.  If free packet context is found from the list
53           it is returned instead of allocating a new one.  The library
54           could at first allocate them and save them to the free list
55           until enough contexts for smooth processing exists in the list.
56           This would remove a big allocation since the structure is
57           quite big, and even bigger if it would include the parse_ctx.
58
59           The packet->buffer can be optimized too if the SilcBuffer
60           interface would support free lists as well.  Maybe such could
61           be done in the same way as for SilcPacketContext.  The
62           silc_buffer_alloc would check free list before actually 
63           allocating new memory.  Since the packets in the SILC protocol
64           usually are about the same size (due to padding) it would be
65           easy to find suitable size buffer from the free list very
66           quickly.
67
68           These naturally cause the overal memory consumption to grow
69           but would take away many allocations that can be done several
70           times in a second (see also ~/silcpacket).
71
72         o Move the actual file descriptor task callback (the callback that
73           handles the incoming data, outgoing data etc, that is implemnted
74           in server and client separately (silc_server_packet_process and
75           silc_client_packet_proces)) to the low level socket connection
76           handling routines, and create an interface where the application
77           can register a callbacks for incoming data, outoing data and EOF
78           receiving, which the library will call when necessary.  This way 
79           we can move the data handling in one place.
80
81         o Add silc_id_str2id to accept the destination buffer as argument
82           and thus not require any memory allocation.  Same will happen
83           with silc_id_payload_* functions.
84
85         o Remove the `truelen' field from SilcBuffer as it is entirely
86           redundant since we can get the true length of the buffer by
87           doing buffer->end - buffer->header.  Add SILC_BUFFER_TRUELEN
88           macro instead.  Consider also removing `len' field too since
89           it effectively is buffer->tail - buffer->data, and adding
90           SILC_BUFFER_LEN macro can do the same.  These would save
91           totally 8 bytes of memory per buffer.
92
93  o Optimizations in Server
94
95         o Remove the big switch statement from the function 
96           silc_server_packet_parse_type and replace it with predefined
97           table of function pointers where each of the slot in table
98           represents the packet type value.
99
100           Same could be done with notify packets which has big switch 
101           statement too.  Same kind of table of notify callbacks could be
102           done as well.
103
104         o The parser callback in the server will add a timeout task for
105           all packets.  It will require registering and allocating a
106           new task to the SilcSchedule.  Maybe, at least, for server
107           and router packets the parser would be called immediately
108           instead of adding it to the scheduler with 0 timeout.  It
109           should be analyzed too how slow the task registering process
110           actually is, and find out ways to optimize it.
111
112         o The SERVER_SIGNOFF notify handing is not optimal, because it'll
113           cause sending of multiple SIGNOFF notify's instead of the one
114           SERVER_SIGNOFF notify that the server received.  This should be
115           optimized so that the only SERVER_SIGNOFF is sent and not
116           SIGNOFF of notify at all (using SIGNOFF takes the idea about
117           SERVER_SIGNOFF away entirely).
118
119  o Add SilcAsyncOperation to utility library.  Any function that takes
120    callback as an argument must/should return SilcAsyncOperation (see 
121    ~/silcasync).
122
123  o Rewrite SilcProtocol to be SilcFSM (see ~/silcfsm).
124
125  o Do some scheduler optimizations and interface changes (see 
126    ~/silcschedule).
127
128  o Change the lib/silccore/silcpacket.[ch] interfaces (see ~/silcpacket).
129
130  o Add abstract SilcStream and SilcSocketStream (see ~/silcstream).
131
132  o Change some of the SILC Net interfaces (see ~/silcnet).
133
134  o Add DSS support.
135
136  o SILC RNG does not implement random seed files, and they should be
137    implemented.
138
139  o Cipher optimizations (asm, that this) at least for i386 would be nice.
140
141  o Add builtin SOCKS and HTTP Proxy support, well the SOCKS at least.
142    SILC currently supports SOCKS4 and SOCKS5 but it needs to be compiled
143    in separately.
144
145  o EPOC specific additions/changes required:
146
147         o lib/silcutil/epoc routines missing or not completed.
148
149         o The PKCS#1 also calls global RNG (even though it is not used 
150           currently in SILC, the interface allows its use).
151
152         o Something needs to be thought to the logging globals as well, 
153           like silc_debug etc.  They won't work on EPOC.  Perhaps logging
154           and debugging is to be disabled on EPOC.
155
156  o Check whether we can fully comply with RFC 2779.
157
158
159 TODO in SILC Protocol
160 =====================
161
162  o Inviting and banning by public key should be made possible.  To be
163    included in protocol version 1.2.
164
165  o UTF-8 support/requirement for nicknames & channel names.  UTF-8 support
166    in terminals and OS's are so hazy that this matter is left for
167    consideration in next version of the protocol (1.2).  For good UTF-8
168    reference and tutorial see: http://www.cl.cam.ac.uk/~mgk25/unicode.html.
169    What should CLI application do if it receives nickname that it cannot
170    display without messing up the terminal?  If UTF-8 is mandatory in 
171    SILC then SILC clients cannot be allowed to start on terminals that do
172    not support UTF-8 (which renders 98% of users unable to use CLI SILC
173    app without hacking their environment).  See also site
174    http://gratrix.net/unicode/