updates
authorPekka Riikonen <priikone@silcnet.org>
Tue, 5 Mar 2002 12:29:43 +0000 (12:29 +0000)
committerPekka Riikonen <priikone@silcnet.org>
Tue, 5 Mar 2002 12:29:43 +0000 (12:29 +0000)
CHANGES
TODO
lib/silccrypt/silccipher.c
lib/silccrypt/silccipher.h
lib/silccrypt/silchash.c
lib/silccrypt/silchash.h
lib/silccrypt/silchmac.c
lib/silccrypt/silchmac.h
lib/silccrypt/silcpkcs.c
lib/silccrypt/silcpkcs.h
lib/silcsftp/sftp_fs_memory.c

diff --git a/CHANGES b/CHANGES
index 0f8488b684abbf7bb4c37b3250c8dfefc3d3eacf..214a080af69b89215db0caa4fac9bb3ff583c5ac 100644 (file)
--- a/CHANGES
+++ b/CHANGES
@@ -1,3 +1,10 @@
+Tue Mar  5 14:37:27 EET 2002  Pekka Riikonen <priikone@silcnet.org>
+
+       * Changed all silc_[hash|hmac|cipher|pkcs]_default tables to
+         constants.  Affected files in
+         lib/silccrypt/silcpkcs.[ch], silchash.[ch], silchmac.[ch] and
+         silccipher.[ch].
+
 Sun Mar  3 18:37:13 EET 2002  Pekka Riikonen <priikone@silcnet.org>
 
        * Fixed the buffer formatting and unformatting routines to
diff --git a/TODO b/TODO
index 52f0769d1ccb21d91954e5ea2b4646d67d6d5838..4af357e61b520ee0124b99243cf3479763e489da 100644 (file)
--- a/TODO
+++ b/TODO
@@ -100,6 +100,28 @@ TODO/bugs In SILC Libraries
    context it provides, which is delivered by SFTP libary to all 
    callback functions.
 
+ o EPOC specific additions/changes required:
+
+       o lib/silcutil/epoc routines missing or not completed.
+
+       o Rewrite the lib/silcutil/silcprotocol.[ch] not to have 
+         [un]register functions, but to make it context based all the 
+         way.  The alloc should take as argument the protocol type and 
+         its callback (not only final callback).  It is not good that we 
+         have now global list of registered protocols.
+
+       o Global RNG should not be allowed on EPOC, since it won't
+         work.  Every function in library that calls the global RNG must
+         also take the RNG context as argument so that application can
+         provide it if it doesn't want to use global RNG.
+
+       o Think some solution to the global crypto lists in lib/silccrypt.
+         They won't work on EPOC.
+
+       o Something needs to be thought to the logging globals as well, 
+         like silc_debug etc.  They won't work on EPOC.  Perhaps logging
+         and debugging is to be disabled on EPOC.
+
 
 TODO in Toolkit Documentation
 =============================
@@ -233,12 +255,6 @@ least could be done.
    compression thus it must be implemented.  SILC Zip API must be
    defined.
 
- o Rewrite the lib/silcutil/silcprotocol.[ch] not to have [un]register 
-   functions, but to make it context based all the way.  The alloc should 
-   take as argument the protocol type and its callback (not only 
-   final callback).  It is not good that we have now global list of 
-   registered protocols.
-
  o Optimizations in Libraries
 
        o There is currently three (3) allocations per packet in the
index 35155c5103379a048a8063340d4aba7892129a0c..d07de22af88d5e9e43a63dd25d732006dcfc9877 100644 (file)
@@ -27,7 +27,7 @@
 SilcDList silc_cipher_list = NULL;
 
 /* Static list of ciphers for silc_cipher_register_default(). */
-SilcCipherObject silc_default_ciphers[] =
+const SilcCipherObject silc_default_ciphers[] =
 {
   { "aes-256-cbc", 16, 256, silc_aes_set_key, 
     silc_aes_set_key_with_string, silc_aes_encrypt_cbc,
@@ -162,7 +162,7 @@ bool silc_cipher_register_default(void)
   int i;
 
   for (i = 0; silc_default_ciphers[i].name; i++)
-    silc_cipher_register(&(silc_default_ciphers[i]));
+    silc_cipher_register((SilcCipherObject *)&(silc_default_ciphers[i]));
 
   return TRUE;
 }
index 205adb8340d5f9e2a5c035189ed513f898a5d1c6..3c1d549aca3b2efe1034df22f5b42680b888c8ef 100644 (file)
@@ -74,7 +74,7 @@ typedef struct SilcCipherStruct {
 #define SILC_ALL_CIPHERS ((SilcCipherObject *)1)
 
 /* Static list of ciphers for silc_cipher_register_default(). */
-extern DLLAPI SilcCipherObject silc_default_ciphers[];
+extern DLLAPI const SilcCipherObject silc_default_ciphers[];
 
 /* Default cipher in the SILC protocol */
 #define SILC_DEFAULT_CIPHER "aes-256-cbc"
index 4bb91087de51a278d8478aefd2cbc773f54a221c..66a6ab8ef5dcf8e0dbb06979c7686ddf666b9790 100644 (file)
@@ -28,7 +28,7 @@
 SilcDList silc_hash_list = NULL;
 
 /* Default hash functions for silc_hash_register_default(). */
-SilcHashObject silc_default_hash[] = 
+const SilcHashObject silc_default_hash[] = 
 {
   { "sha1", 20, 64, silc_sha1_init, silc_sha1_update, silc_sha1_final,
     silc_sha1_transform, silc_sha1_context_len },
@@ -112,7 +112,7 @@ bool silc_hash_register_default(void)
   int i;
 
   for (i = 0; silc_default_hash[i].name; i++)
-    silc_hash_register(&(silc_default_hash[i]));
+    silc_hash_register((SilcHashObject *)&(silc_default_hash[i]));
 
   return TRUE;
 }
index 8de3e5eb8db07bab37319c8efb44addef2c69df2..c5091240990ee53e4c978fb9f614d0a56d967446 100644 (file)
@@ -49,7 +49,7 @@ typedef struct SilcHashStruct {
 #define SILC_ALL_HASH_FUNCTIONS ((SilcHashObject *)1)
 
 /* Default hash functions for silc_hash_register_default(). */
-extern DLLAPI SilcHashObject silc_default_hash[];
+extern DLLAPI const SilcHashObject silc_default_hash[];
 
 /* Default HASH function in the SILC protocol */
 #define SILC_DEFAULT_HASH "sha1"
index babadd05788bb6a4aac42eced701b0a0d147fb18..4c7013059c6ea789eafe28af85f6f062ab9cb2c7 100644 (file)
@@ -38,7 +38,7 @@ struct SilcHmacStruct {
 SilcDList silc_hmac_list = NULL;
 
 /* Default hmacs for silc_hmac_register_default(). */
-SilcHmacObject silc_default_hmacs[] =
+const SilcHmacObject silc_default_hmacs[] =
 {
   { "hmac-sha1-96", 12 },
   { "hmac-md5-96", 12 },
@@ -145,7 +145,7 @@ bool silc_hmac_register_default(void)
   int i;
 
   for (i = 0; silc_default_hmacs[i].name; i++)
-    silc_hmac_register(&(silc_default_hmacs[i]));
+    silc_hmac_register((SilcHmacObject *)&(silc_default_hmacs[i]));
 
   return TRUE;
 }
index 37d28c5985b25a4d99d49a6af5c4e7ecaee2ed69..a64b5366f0b5693d6dacf55c75672b1ab0dd2bbd 100644 (file)
@@ -73,7 +73,7 @@ typedef struct {
 #define SILC_ALL_HMACS ((SilcHmacObject *)1)
 
 /* Default hmacs for silc_hmac_register_default(). */
-extern DLLAPI SilcHmacObject silc_default_hmacs[];
+extern DLLAPI const SilcHmacObject silc_default_hmacs[];
 
 /* Default HMAC in the SILC protocol */
 #define SILC_DEFAULT_HMAC "hmac-sha1-96"
index 21821257fe37114a1692dba24683174f72d778c5..e1497387d67a087f762f40fde64a01255f433ff6 100644 (file)
@@ -28,7 +28,7 @@
 SilcDList silc_pkcs_list = NULL;
 
 /* Static list of PKCS for silc_pkcs_register_default(). */
-SilcPKCSObject silc_default_pkcs[] =
+const SilcPKCSObject silc_default_pkcs[] =
 {
   /* RSA with PKCS #1 (Uses directly routines from Raw RSA operations) */
   { "rsa", 
@@ -118,7 +118,7 @@ bool silc_pkcs_register_default(void)
   int i;
 
   for (i = 0; silc_default_pkcs[i].name; i++)
-    silc_pkcs_register(&(silc_default_pkcs[i]));
+    silc_pkcs_register((SilcPKCSObject *)&(silc_default_pkcs[i]));
 
   return TRUE;
 }
index 97fc45c142ce1ffc6fba7e5c92b2919507e01205..5c1542ce3c9afb393396bd5bffe187e42d24d3d2 100644 (file)
@@ -97,7 +97,7 @@ typedef struct {
 #define SILC_ALL_PKCS ((SilcPKCSObject *)1)
 
 /* Static list of PKCS for silc_pkcs_register_default(). */
-extern DLLAPI SilcPKCSObject silc_default_pkcs[];
+extern DLLAPI const SilcPKCSObject silc_default_pkcs[];
 
 /* Default PKXS in the SILC protocol */
 #define SILC_DEFAULT_PKCS "rsa"
index b60cce73cb6c9c80f6871cea83904480d3b2770a..621fdee7873e14973c1f5cbead303870674adbee 100644 (file)
@@ -26,7 +26,7 @@
 
 #define DIR_SEPARATOR "/"
 
-struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory;
+const struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory;
 
 /* Memory filesystem entry */
 typedef struct MemFSEntryStruct {
@@ -320,7 +320,8 @@ SilcSFTPFilesystem silc_sftp_fs_memory_alloc(SilcSFTPFSMemoryPerm perm)
   fs->root->name = strdup(DIR_SEPARATOR);
 
   filesystem = silc_calloc(1, sizeof(*filesystem));
-  filesystem->fs = &silc_sftp_fs_memory;
+  filesystem->fs = 
+    (struct SilcSFTPFilesystemOpsStruct *)&silc_sftp_fs_memory;
   filesystem->fs_context = (void *)fs;
 
   return filesystem;
@@ -1014,7 +1015,7 @@ void mem_extended(void *context, SilcSFTP sftp,
              callback_context);
 }
 
-struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory = {
+const struct SilcSFTPFilesystemOpsStruct silc_sftp_fs_memory = {
   mem_get_handle,
   mem_encode_handle,
   mem_open,